home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / turbo_tk.arc / MANUAL.TTT < prev    next >
Text File  |  1988-01-25  |  115KB  |  6,403 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           This file contains an abridged version of the user manual. The only
  8.           reason for not including the full manual on the disk is that it takes
  9.           too much space and it is formatted for a typeset printer, not an ascii
  10.           file.
  11.  
  12.           If you use the product, please register your copy. One of the benefits
  13.           of full registration is a top quality bound manual.
  14.  
  15.           Enjoy
  16.  
  17.           
  18.  
  19.           Bob "Technojock" Ainsbury
  20.  
  21.           P.S. The abridged version is 97 pages long!!
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      
  74.  
  75.  
  76.      C          H           A          P           T          E           R
  77.      
  78.  
  79.                                                                           1
  80.  
  81.  
  82.      USING THE TOOLKIT
  83.  
  84.  
  85.  
  86.      INTRODUCTION
  87.  
  88.      TechnoJocks Turbo Toolkit is a collection of procedures and functions
  89.      for Turbo Pascal programmers. It will reduce the time taken to write
  90.      applications and is designed for novice and expert programmer alike.
  91.  
  92.      The real purpose of the Toolkit is to provide easy-to-implement
  93.      procedures that free the programmer from the more tedious and
  94.      repetitive programming chores, such as windows, menus, user input,
  95.      string formatting, directory listing etc. The programmer (or software
  96.      engineer if you are from California!) can concentrate on the real
  97.      purpose of the program.
  98.  
  99.      The Toolkit is designed specifically to operate with Turbo Pascal v4.0
  100.      from Borland International. (Contact TechnoJock for versions that work
  101.      with other compilers.) The full source code for all of the Toolkit is
  102.      included so that the code may be reviewed and modified.
  103.  
  104.      The quickest way of gaining an appreciation of the capabilities of the
  105.      Toolkit is to execute the program DemoTTT.exe. This program
  106.      demonstrates most of the procedures and functions available. The demo
  107.      itself was, of course, written with the Toolkit. If you haven't run it
  108.      yet, run it now!
  109.  
  110.  
  111.  
  112.      DISTRIBUTION DISK
  113.  
  114.      Listed below are the files contained on the distribution disk:
  115.  
  116.      FastTTT.pas         source code for screen writing unit
  117.      FastTTT.tpu         screen writing unit
  118.      FastTTT.asm         assembler source code for screen writing unit
  119.      FastTTT.obj         assembler object code for screen writing unit
  120.  
  121.      WinTTT.pas          source code for window unit
  122.      WinTTT.tpu          window unit
  123.      WinTTT.asm          assembler source code for window unit
  124.      WinTTT.obj          assembler object code for window unit
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           KeyTTT.pas          source code for keyboard/mouse unit
  140.           KeyTTT.tpu          keyboard/mouse unit
  141.  
  142.           MenuTTT.pas    source code for menu unit
  143.           MenuTTT.tpu    menu unit
  144.  
  145.           PullTTT.pas         source code for pulldown menu unit
  146.           PullTTT.tpu         pulldown menu unit
  147.  
  148.           DirTTT.pas          source code for directory lister unit
  149.           DirTTT.tpu          directory lister unit
  150.  
  151.           StrngTTT.pas        source code for string unit
  152.           StrngTTT.tpu        string unit
  153.  
  154.           IOTTT.pas      source code for screen input unit
  155.           IOTTT.tpu      screen input unit
  156.  
  157.           MiscTTT.pas         source code for miscellaneous unit
  158.           MiscTTT.tpu         miscellaneous unit
  159.  
  160.           ReadTTT.pas         source code for single line input unit
  161.           ReadTTT.tpu         single line input unit
  162.  
  163.           DemoTTT.pas    source code for flagship demonstration program
  164.           DemoTTT.exe    executable demonstration program
  165.  
  166.           In addition to the above files, there are a number of demonstration
  167.           files that are designed to illustrate how to use unit. Each
  168.           demonstration filename is of the format ?????dem.pas.
  169.  
  170.  
  171.  
  172.           INSTALLING THE TOOLKIT
  173.  
  174.           All you need to do to install the Toolkit is copy the unit files
  175.           (i.e.'*.TPU') from the distribution disk to the directory where the
  176.           Turbo Pascal units (such as CRT.TPU) are stored.
  177.  
  178.           If you are not sure which directory the units are stored in, copy them
  179.           into the directory where you execute Turbo. You can check your default
  180.           directories by executing the Turbo integrated environment (Turbo.exe)
  181.           and selecting the DIRECTORIES pick from the OPTIONS menu - refer to
  182.           the Turbo Pascal Owners Handbook, page 163.
  183.  
  184.           In addition, you could copy all the other files to your working Turbo
  185.           directory, but this is only necessary if you wish to modify the source
  186.           code or execute the demo programs.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.      HOW THE TOOLKIT WORKS
  206.  
  207.      Basics -- Turbo Pascal allows libraries of constants, data types,
  208.      variables, procedures and functions to be grouped together into UNITS.
  209.      The Toolkit provides a variety of different units ready to use in your
  210.      programs. Each unit (a file with an extension of '.TPU') is already
  211.      debugged and fully functional, all you have to do is indicate in your
  212.      program which units you want to use and then all the power of the unit
  213.      is available. Refer to Chapter 4 (page 61) of the Turbo Pascal Owners
  214.      Handbook for a much more eloquent and detailed explanation of units.
  215.  
  216.      You do not need to understand the internal workings of any of the
  217.      Toolkit units in order to use them - all you need to know is how to
  218.      call the procedures and functions.
  219.  
  220.  
  221.      Example 1
  222.  
  223.      The technique is best illustrated with an example. In the unit FastTTT
  224.      there is a procedure for drawing boxes called BOX. A somewhat
  225.      primitive program to draw a box on the screen would be as follows:
  226.  
  227.  
  228.                PROGRAM TOOLKIT_DEMO;
  229.                USES FASTTTT;
  230.                
  231.                BEGIN
  232.                    BOX(1,1,80,25,15,4,1);
  233.                END.
  234.      
  235.  
  236.      All you need to know is the unit that contains the procedure Box and
  237.      the syntax of the Box procedure. (If you must, take a peek at page 10
  238.      to see the detailed documentation for the BOX procedure!) That's all
  239.      there is to it - no need to worry about drawing horizontal and
  240.      vertical lines, or what the ascii codes are for the box corners etc.
  241.  
  242.  
  243.      Example 2
  244.  
  245.      The above example is useful to illustrate the most basic concept of
  246.      the toolkit but it is unlikely that you will always be writing five
  247.      line programs! More typically, you will want to use procedures and
  248.      functions from a variety of the Toolkit units. All you need to do is
  249.      "use" all the units that contain the procedures you want to call. For
  250.      example, let's say we want to expand the above program to draw a
  251.      filled box and write the date in a neat (!) format at the top of the
  252.      screen:
  253.  
  254.  
  255.                
  256.  
  257.                PROGRAM IMPROVED_TOOLKIT_DEMO;
  258.                USES FASTTTT, DOS, MISCTTT;
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                     
  272.                     BEGIN
  273.                         FBOX(1,1,80,25,15,4,1);
  274.                         WRITECENTER(2,14,4,DATE);
  275.                     END.
  276.           
  277.  
  278.           The FBox and WriteCenter procedures are in the FastTTT unit and the
  279.           Date function is in the MiscTTT unit. But, the MiscTTT unit itself
  280.           needs to use the DOS unit (OK, take a quick look at page 115 and see
  281.           the documentation for DATE!). The order of the units declared in the
  282.           USES statement is important but the Toolkit documentation clearly
  283.           indicates which units must be declared and in what order. As a habit,
  284.           I recommend that the first unit in the uses statement should be CRT -
  285.           this is the screen handler unit distributed with the compiler and
  286.           includes commonly used procedures and functions such as ClrScr.
  287.  
  288.           Refer to page 65 of the Turbo Pascal Owners Handbook for further
  289.           information about the uses clause.
  290.  
  291.           The ?????DEM.pas files on the distribution disk are designed to
  292.           further illustrate the basic use of the Toolkit
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      Attr                                                           FastTTT
  338.      
  339.  
  340.  
  341.      Purpose   To combine foreground and background colors as a single
  342.                attribute byte.
  343.  
  344.      Result type    byte;
  345.  
  346.      Declaration    Attr(F,B:byte):byte;
  347.                     
  348.                     F is the foreground color (0..15)
  349.                     B is the background color (0..15)
  350.  
  351.      Uses FastTTT.
  352.  
  353.      Remarks   The video memory for an 80 by 25 character screen is
  354.                composed of 2000 bytes of data. There is an attribute byte
  355.                and a character byte for each of the 1000 character
  356.                positions on the screen. This simple function will combine a
  357.                foreground color (F) with a background color (B) to form a
  358.                single attribute byte.
  359.                
  360.                The valid color ranges are 0 to 15. (Refer to Appendix B for
  361.                a color table.)
  362.                
  363.                If a background color is set greater than 7 then "flashing"
  364.                characters will result.
  365.  
  366.      See also  Fastwrit, PlainWrite.
  367.  
  368.      Example
  369.  
  370.  
  371.                USES FASTTTT;
  372.                VAR MSG_COL : BYTE;
  373.                BEGIN
  374.                    MSG_COL := ATTR(15,4);
  375.                END.
  376.      
  377.  
  378.      The color attribute MSG_COL would be set to white on a red background.
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           Box                                                            FastTTT
  404.           
  405.  
  406.  
  407.           Purpose   To draw a rectangle or box on the screen.
  408.  
  409.           Declaration    Box(X1,Y1,X2,Y2,F,B,Boxtype: byte);
  410.                     
  411.                     X1 is the top left X coordinate (1..79)
  412.                     Y1 is the top left Y coordinate (1..24)
  413.                     X2 is lower right X coordinate (2..80)
  414.                     Y2 is lower right Y coordinate (2..25)
  415.                     F is the foreground color (0..15)
  416.                     B is the background color (0..15)
  417.                     Boxtype is the box line type (see remarks)
  418.  
  419.           Uses FastTTT.
  420.  
  421.           Remarks   The area inside the box is not cleared.
  422.                     
  423.                     The normal values for the Boxtype are:
  424.                          1    Single line
  425.                          2    Double line
  426.                          3    Single top/bottom, double sides
  427.                          4    Double top/bottom, single sides
  428.                     
  429.                     If a BoxType of 0 is passed the the procedure will use a
  430.                     space (' ') as the box character. If any other number (i.e.
  431.                     5..256) is used, the box is drawn using the ascii character
  432.                     represented by the number. Refer to the Turbo Pascal Owner's
  433.                     Handbook page 568 to see the ascii table.
  434.  
  435.           See also  FBox, GrowFBox.
  436.  
  437.           Example
  438.  
  439.  
  440.                     USES CRT, FASTTTT;
  441.                     BEGIN
  442.                         CLRSCR;
  443.                         BOX(1,1,80,12,WHITE,RED,1);
  444.                         BOX(1,13,80,25,BLUE,LIGHTGRAY,2);
  445.                     END.
  446.           
  447.  
  448.           The screen would be cleared, a single lined box would be drawn on the
  449.           top half of the screen, and a double lined box in the lower half. Note
  450.           that the CRT unit was also USED - this allowed the use of ClrScr, and
  451.           the colors could be referred to by name rather than their numeric
  452.           code.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.      ClearLine                                                      FastTTT
  470.      
  471.  
  472.  
  473.      Purpose   To clear all text on a specific line of the screen.
  474.  
  475.      Declaration    ClearLine(Y,F,B:integer);
  476.                
  477.                Y is the line number on the screen to be cleared (1..25)
  478.                F is the foreground color of the blank line (0..15)
  479.                B is the background color of the blank line (0..15)
  480.  
  481.      Uses FastTTT.
  482.  
  483.      Remarks   The actual display color of the line will be set to B. The
  484.                only reason for setting the foreground color is to change
  485.                the attribute byte, for subsequent writes.
  486.  
  487.      See also  ClearText.
  488.  
  489.      Example
  490.  
  491.  
  492.                USES FASTTTT;
  493.                BEGIN
  494.                    CLEARLINE(25,15,0);
  495.                END.
  496.      
  497.  
  498.      The 25th line of the screen is cleared with a black background.
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           ClearText                                                      FastTTT
  536.           
  537.  
  538.  
  539.           Purpose   To clear all text on a rectangular section of the screen.
  540.  
  541.           Declaration    ClearText(X1,Y1,X2,Y2,F,B:integer);
  542.                     
  543.                     X1 is the top left X coordinate (1..79)
  544.                     Y1 is the top left Y coordinate (1..24)
  545.                     X2 is lower right X coordinate (2..80)
  546.                     Y2 is lower right Y coordinate (2..25)
  547.                     
  548.                     F is the foreground color of the blank line (0..15)
  549.                     B is the background color of the blank line (0..15)
  550.  
  551.           Uses FastTTT.
  552.  
  553.           Remarks   The actual display color of the area will be set to B. The
  554.                     only reason for setting the foreground color is to change
  555.                     the attribute byte, for subsequent writes.
  556.  
  557.           See also  ClearLine, PlainWrite.
  558.  
  559.           Example
  560.  
  561.  
  562.                     USES FASTTTT;
  563.                     BEGIN
  564.                         CLEARTEXT(1,1,40,25,15,0);
  565.                     END.
  566.           
  567.  
  568.           The lefthand side of the screen is cleared with a black background.
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.      CurrentDisplay                                                 FastTTT
  602.      
  603.  
  604.  
  605.      Purpose   Used internally to determine the current type of videocard.
  606.  
  607.      Result    DisplayType;
  608.  
  609.      Declaration    CurrentDisplay: DisplayType;
  610.                
  611.                The DisplayType is Monochrome, CGA, EGA, MCGA,  or VGA
  612.  
  613.      Uses FastTTT.
  614.  
  615.      Remarks   This function is used internally.
  616.  
  617.      See also  ReinitFastwrite
  618.  
  619.      
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.           Fastwrite                                                      FastTTT
  668.           
  669.  
  670.  
  671.           Purpose   The core procedure of the unit for fast screen writes.
  672.  
  673.           Declaration    Fastwrit(Col, Row, Attr:byte; St: string);external
  674.                     
  675.                     Col is the X coord of first char. in string (1..80)
  676.                     Row is the Y coord of string (1..25)
  677.                     Attr is the color attribute
  678.                     St is the string or text to be displayed
  679.  
  680.           Uses FastTTT.
  681.  
  682.           Remarks   This procedure is external and the source code is actually
  683.                     in assembly language. (See the file FastTTT.asm on the
  684.                     distribution disk, if you're interested.) I recommend you
  685.                     use the WriteAT procedure in preference to Fastwrit, because
  686.                     it can pass foreground and background colors rather then the
  687.                     combined color attribute. If the text is too long to fit on
  688.                     the screen, it will be wrapped onto the next line.
  689.  
  690.           See also  Attr, WriteAT, PlainWrite, WriteVert.
  691.  
  692.           Example
  693.  
  694.  
  695.                     USES FASTTTT
  696.                     BEGIN
  697.                         FASTWRITE(1,1,14,'TOP LEFT OF SCREEN');
  698.                         FASTWRITE(59,25,ATTR(14,4),'BOTTOM RIGHT OF SCREEN;);
  699.                     END;
  700.           
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.      FBox                                                           FastTTT
  734.      
  735.  
  736.  
  737.      Purpose   To draw a box and clear the screen inside the box.
  738.  
  739.      Declaration    FBox(X1,Y1,X2,Y2,F,B,Boxtype:integer);
  740.                
  741.                X1 is the top left X coordinate (1..79)
  742.                Y1 is the top left Y coordinate (1..24)
  743.                X2 is lower right X coordinate (2..80)
  744.                Y2 is lower right Y coordinate (2..25)
  745.                F is the foreground color (0..15)
  746.                B is the background color (0..15)
  747.                Boxtype is the box line type (see remarks)
  748.  
  749.      Uses FastTTT.
  750.  
  751.      Remarks   The normal values for the Boxtype are:
  752.                     1    Single line
  753.                     2    Double line
  754.                     3    Single top/bottom, double sides
  755.                     4    Double top/bottom, single sides
  756.                
  757.                If a BoxType of 0 is passed, the procedure will use a space
  758.                (' ') as the box character. If any other number (i.e.
  759.                5..256) is used, the box is drawn using the ascii character
  760.                represented by the number. Refer to page 568 of the Turbo
  761.                Pascal Owner's Handbook to see the ascii table.
  762.  
  763.      See also  Box, GrowFBox.
  764.  
  765.      Example
  766.  
  767.  
  768.                USES CRT, FASTTTT;
  769.                BEGIN
  770.                    FBOX(1,1,80,12,WHITE,RED,1);
  771.                    FBOX(1,13,80,25,BLUE,LIGHTGRAY,2);
  772.                END.
  773.      
  774.  
  775.      A single lined box would be drawn on the top half of the screen and
  776.      the area inside the box would be cleared to a red background. A double
  777.      lined box would be drawn in the lower half, and the area inside the
  778.      box would be cleared to lightgray. Note that the CRT unit was also
  779.      USED, so the colors could be refered to by name rather than their
  780.      numeric code.
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.           GrowFBox                                                       FastTTT
  800.           
  801.  
  802.  
  803.           Purpose   To draw a box and clear the screen inside the box. This
  804.                     procedure is the functional equivalent to FBox, but the box
  805.                     grows (or explodes!) on the screen for a fancy visual
  806.                     effect.
  807.  
  808.           Declaration    GrowFBox(X1,Y1,X2,Y2,F,B,Boxtype:integer);
  809.                     
  810.                     X1 is the top left X coordinate (1..79)
  811.                     Y1 is the top left Y coordinate (1..24)
  812.                     X2 is lower right X coordinate (2..80)
  813.                     Y2 is lower right Y coordinate (2..25)
  814.                     F is the foreground color (0..15)
  815.                     B is the background color (0..15)
  816.                     Boxtype is the box line type (see remarks)
  817.  
  818.           Uses FastTTT.
  819.  
  820.           Remarks   The normal values for the Boxtype are:
  821.                          1    Single line
  822.                          2    Double line
  823.                          3    Single top/bottom, double sides
  824.                          4    Double top/bottom, single sides
  825.                     
  826.                     If a BoxType of 0 is passed the the procedure will use a
  827.                     space (' ') as the box character. If any other number (i.e.
  828.                     5..256) is used the box is drawn using the ascii character
  829.                     represented by the number. Refer to page 568 of the Turbo
  830.                     Pascal Owner's Handbook to see the ascii table.
  831.                     
  832.                     If the box grows too quickly or too slowly, alter the global
  833.                     variable Speed. The default value is 200; increase the value
  834.                     to slow the speed down (ugh!) or decrease it to speed the
  835.                     box up.
  836.  
  837.           
  838.  
  839.           See also  Box, FBox.
  840.  
  841.           Example
  842.  
  843.  
  844.                     USES CRT, FASTTTT;
  845.                     BEGIN
  846.                         SPEED := 400;
  847.                         GROWFBOX(1,1,80,12,WHITE,RED,1);
  848.                         GROWFBOX(1,13,80,25,BLUE,LIGHTGRAY,2);
  849.                     END.
  850.           
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.      HorizLine                                                      FastTTT
  866.      
  867.  
  868.  
  869.      Purpose   To draw a horizontal line on the screen.
  870.  
  871.      Declaration    HorizLine(X1,X2,Y,F,B,LineType: integer);
  872.                
  873.                X1 is the left X coordinate (1..79)
  874.                X2 is the right X coordinate (2..80)
  875.                Y is the Y coordinate (1..25)
  876.                F is the foreground color (0..15)
  877.                B is the background color (0..15)
  878.                Linetype is the line type (see remarks)
  879.  
  880.      Uses FastTTT.
  881.  
  882.      Remarks   The normal values for the Linetype are:
  883.                     1    Single line
  884.                     2    Double line
  885.                     
  886.                X2 may be larger than X1.
  887.  
  888.      See also  VertLine
  889.  
  890.      Example
  891.  
  892.  
  893.                USES CRT,FASTTTT;
  894.                BEGIN
  895.                    HORIZTLINE(10,17,13,LIGHTCYAN,BLUE,1);
  896.                END.
  897.      
  898.  
  899.      Draws a single horizontal line across the center of the screen.
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.           PlainWrite                                                     FastTTT
  932.           
  933.  
  934.  
  935.           Purpose   To write text to the screen very quickly in the default
  936.                     color attribute.
  937.  
  938.           Declaration    PlainWrite(Col, Row: byte; St: string); external;
  939.                     
  940.                     Col is the X coord of first char. in string (1..80)
  941.                     Row is the Y coord of string (1..25)
  942.                     St is the string or text to be displayed
  943.  
  944.           Uses FastTTT.
  945.  
  946.           Remarks   This procedure is external and the source code is actually
  947.                     in assembly language (see the file FastTTT.asm on the
  948.                     distribution disk, if you're interested). This procedure is
  949.                     very similar to Fastwrite but it uses the current color
  950.                     attribute for each character. It is even faster than
  951.                     Fastwrite!
  952.  
  953.           See also  WriteAT, FastWrite, WriteVert.
  954.  
  955.           Example
  956.  
  957.  
  958.                     USES CRT, FASTTTT
  959.                     BEGIN
  960.                         CLEARTEXT(1,1,80,25,WHITE,BLACK);
  961.                         PLAINWRITE(1,1,'TOP LEFT OF SCREEN');
  962.                         PLAINWRITE(59,25,'BOTTOM RIGHT OF SCREEN;);
  963.                     END;
  964.           
  965.  
  966.           The screen is cleared to a black background with a white foreground,
  967.           and the two phrases are written to the screen in white letters.
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.      ReInitFastWrite                                                FastTTT
  998.      
  999.  
  1000.  
  1001.      Purpose   To initialize variables referenced internally by Fastwrite.
  1002.  
  1003.      Declaration    ReinitFastWrite;external;
  1004.  
  1005.      Uses FastTTT.
  1006.  
  1007.      Remarks   This procedure is automatically called at the commencement
  1008.                of any program that uses the FastTTT unit. (Refer to page 64
  1009.                of the Turbo Pascal Owner's Handbook for a further
  1010.                explanation of initialized procedures.) It would not
  1011.                normally be necessary to call this procedure.
  1012.                
  1013.                This procedure is external and the source code is actually
  1014.                in assembly language. (See the file FastTTT.asm on the
  1015.                distribution disk, if you're interested.)
  1016.  
  1017.      
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           Replicate                                                      FastTTT
  1064.           
  1065.  
  1066.  
  1067.           Purpose   To construct a string of repeated characters
  1068.  
  1069.           Declaration    (N:byte; C:Char): string;
  1070.  
  1071.           Uses FastTTT.
  1072.  
  1073.           Result type    String
  1074.  
  1075.           Remarks   This function uses memory moves and is much faster than a
  1076.                     "for" loop.
  1077.  
  1078.           Example
  1079.  
  1080.  
  1081.                     USES FASTTTT;
  1082.                     VAR TXT:STRING;
  1083.                     BEGIN
  1084.                         TXT := REPLICATE(80,'+');
  1085.                         FASTWRITE(1,1,14,TXT);
  1086.                     END.
  1087.           
  1088.  
  1089.           The variable Txt is set to an 80 character string composed of +'s i.e.
  1090.           '++++++++++....+++++++++'. The string is then written to the first
  1091.           line of the screen in yellow. Note that these two procedures could be
  1092.           combined to form a single statement:
  1093.           FastWrite(1,1,14,Replicate(80,'+'));
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.      VertLine                                                       FastTTT
  1130.      
  1131.  
  1132.  
  1133.      Purpose   To draw a vertical line on the screen.
  1134.  
  1135.      Declaration    VertLine(X,Y1,Y2,F,B,LineType: integer);
  1136.                
  1137.                X is the X coordinate (1..80)
  1138.                Y1 is the upper Y coordinate (1..24)
  1139.                Y2 is the lower Y coordinate (2..25)
  1140.                F is the foreground color (0..15)
  1141.                B is the background color (0..15)
  1142.                Linetype is the line type (see remarks)
  1143.  
  1144.      Uses FastTTT.
  1145.  
  1146.      Remarks   The normal values for the Linetype are:
  1147.                     1    Single line
  1148.                     2    Double line
  1149.                     
  1150.                Y2 may be larger than Y1.
  1151.  
  1152.      See also  HorizLine
  1153.  
  1154.      Example
  1155.  
  1156.  
  1157.                USES CRT,FASTTTT;
  1158.                BEGIN
  1159.                    VERTLINE(40,1,25,LIGHTCYAN,BLUE,2);
  1160.                END.
  1161.      
  1162.  
  1163.      Draws a double vertical line down the center of the screen.
  1164.  
  1165.      
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.           WriteAT                                                        FastTTT
  1196.           
  1197.  
  1198.  
  1199.           Purpose   To writes directly to the screen el quicko in specified
  1200.                     colors.
  1201.  
  1202.           Declaration    WriteAT(X,Y,F,B: integer; St: string);
  1203.                     
  1204.                     X is the X coord of first character in the string (1..80)
  1205.                     Y is Y coord of string
  1206.                     F is the foreground color (0..15)
  1207.                     B is the background color (0..15)
  1208.                     St is the text string
  1209.  
  1210.           Uses FastTTT.
  1211.  
  1212.           Remarks   This is the most frequently used procedure in the Toolkit.
  1213.                     It is preferrable to Fastwrite (for most of us), because you
  1214.                     can specify the foreground and background colors separately.
  1215.                     
  1216.                     This procedure cannot be used to write integers or reals -
  1217.                     first convert the number to a string using the Int_to_Str
  1218.                     function in the StrngTTT unit.
  1219.  
  1220.           See also  Fastwrit, PlainWrit, WriteVert.
  1221.  
  1222.           Example
  1223.  
  1224.  
  1225.                     USES CRT,FASTTTT;
  1226.                     CONST
  1227.                         HEADING = 'TOOLKIT';
  1228.                     VAR
  1229.                         NAME: STRING;
  1230.                     BEGIN
  1231.                         NAME := 'BOB ''TECHNOJOCK'' AINSBURY';
  1232.                         WRITEAT(1,25,YELLOW,RED,'PRESS F1 FOR HELP');
  1233.                         WRITEAT(36,1,LIGHTGREEN,BLACK,HEADING);
  1234.                         WRITEAT(1,5,LIGHTCYAN,BLACK,NAME);
  1235.                         WRITEAT(60,20,WHITE,BLACK,'HELLO '+'THERE!');
  1236.                     END.
  1237.           
  1238.  
  1239.           The example writes various strings to the screen, and illustrates that
  1240.           string constants/variables and concatenated strings are valid.
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.      WriteBetween                                                   FastTTT
  1262.      
  1263.  
  1264.  
  1265.      Purpose   To write text centered between two points.
  1266.  
  1267.      Declaration    WriteBetween(X1,X2,Y,F,B: integer; ST: string);
  1268.                
  1269.                X1 is the left most X coord (1..79)
  1270.                X2 is the right most X Coord (2..80)
  1271.                Y is the Y coord or line number (1..25)
  1272.                F is the foreground (0..15)
  1273.                B is the background (0..15)
  1274.                ST is the string or text to be displayed
  1275.  
  1276.      Uses FastTTT.
  1277.  
  1278.      Remarks   If the length of the string is greater than the distance
  1279.                between the X coordinates, the string will simply be written
  1280.                commencing at X1.
  1281.  
  1282.      See also  WriteCenter, WriteAT.
  1283.  
  1284.      Example
  1285.  
  1286.  
  1287.                USES FASTTTT;
  1288.                BEGIN
  1289.                    WRITEBETWEEN(1,40,15,0,'LEFT SIDE');
  1290.                    WRITEBETWEEN(41,80,14,0,'RIGHT SIDE');
  1291.                END.
  1292.      
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           WriteCenter                                                    FastTTT
  1328.           
  1329.  
  1330.  
  1331.           Purpose   To write text on the center of a line
  1332.  
  1333.           Declaration    WriteCenter(Y,F,B: integer; ST: string);
  1334.                     
  1335.                     Y is the Y coord or line number (1..25)
  1336.                     F is the foreground color (0..15)
  1337.                     B is the background color (0..15)
  1338.                     ST is the string or text to be displayed
  1339.  
  1340.           Uses FastTTT.
  1341.  
  1342.           Remarks   The same rules apply as for WriteAT e.g. no reals/integers,
  1343.                     strings may be concatenated etc.
  1344.  
  1345.           See also  WriteAT, WriteBetween.
  1346.  
  1347.           Example
  1348.  
  1349.  
  1350.                     USES FASTTTT;
  1351.                     BEGIN
  1352.                         WRITECENTER(1,13,0,'MAJOR HEADING');
  1353.                     END.
  1354.           
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.      WriteVert                                                      FastTTT
  1394.      
  1395.  
  1396.  
  1397.      Purpose   To write a string vertically.
  1398.  
  1399.      Declaration    WriteVert(X,Y,F,B: integer; ST: string);
  1400.                
  1401.                X is X coord of first character in string (1..25)
  1402.                Y is Y coord of first character in string (1..80)
  1403.                F is the foreground color
  1404.                B is the background color
  1405.                ST is the string or text to be displayed
  1406.  
  1407.      Uses FastTTT.
  1408.  
  1409.      Remarks   This odd little procedure will write a string down the
  1410.                screen rather than across the screen. If the string is too
  1411.                long to fit on the screen, it will be truncated.
  1412.  
  1413.      Example   
  1414.  
  1415.  
  1416.      Uses                                                          FastTTT;
  1417.      begin
  1418.                                       WriteVert(10,5,15,0,'Y        Axis');
  1419.      end.
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.           Attrib                                                          WinTTT
  1460.           
  1461.  
  1462.  
  1463.           Purpose   To change the display color (attribute) for part or all of
  1464.                     the screen.
  1465.  
  1466.           Declaration    Attrib(X1,Y1,X2,Y2,F,B:integer);
  1467.                     
  1468.                     X1 is the top left X coordinate (1..80)
  1469.                     Y1 is the top left Y coordinate (1..25)
  1470.                     X2 is the lower X coordinate (1..80)
  1471.                     Y2 is the lower Y coordinate (1..25)
  1472.                     F is the foreground color (0..15)
  1473.                     B is the background color (0..15)
  1474.  
  1475.           Uses Crt, FastTTT, DOS, WinTTT.
  1476.  
  1477.           Remarks   The characters themselves are not changed, only their
  1478.                     display color.
  1479.  
  1480.           See also  ClearText.
  1481.  
  1482.           Example
  1483.  
  1484.  
  1485.                     USES CRT, FASTTTT, DOS, WINTTT;
  1486.                     BEGIN
  1487.                         ATTRIB(1,13,80,35,LIGHTGRAY,BLACK);
  1488.                     END.
  1489.           
  1490.  
  1491.           The lower half of the screen display is changed to light gray
  1492.           characters on a black background.
  1493.  
  1494.           
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.      CopyScreenBlock                                                 WinTTT
  1526.      
  1527.  
  1528.  
  1529.      Purpose   To copy one part of the screen to another area of the
  1530.                display.
  1531.  
  1532.      Declaration    CopyScreenBlock(X1,Y1,X2,Y2,X,Y:integer);
  1533.                
  1534.                X1 is the top left X coordinate (1..80)
  1535.                Y1 is the top left Y coordinate (1..25)
  1536.                X2 is the lower X coordinate (1..80)
  1537.                Y2 is the lower Y coordinate (1..25)
  1538.                X is the top left X coord of the target location (1..80)
  1539.                Y is the top left Y coord of the target location (1..25)
  1540.  
  1541.      Uses Crt, FastTTT, DOS, WinTTT.
  1542.  
  1543.      Remarks   The data is copied or duplicated to another location on the
  1544.                screen. Use the procedure MoveScreenBlock if you want to
  1545.                physically move the information whilst blanking the source
  1546.                area. The copy operation actually occurs one line at a time,
  1547.                so unexpected results may occur if the source and target
  1548.                zones overlap.
  1549.  
  1550.      See Also  MoveScreenBlock.
  1551.  
  1552.      Example
  1553.  
  1554.  
  1555.                USES CRT, FASTTTT, DOS, WINTTT;
  1556.                BEGIN
  1557.                    COPYSCREENBLOCK(1,1,80,2,1,24);
  1558.                END.
  1559.      
  1560.  
  1561.      The top two lines of the screen are copied to the bottom two lines of
  1562.      the screen.
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           DisposeScreen                                                   WinTTT
  1592.           
  1593.  
  1594.  
  1595.           Purpose   To free heap space that was allocated to store a screen
  1596.                     image.
  1597.  
  1598.           Declaration    DisposeScreen(Page: byte);
  1599.                     
  1600.                     Page is the number of the screen that was saved with save
  1601.                     screen.
  1602.  
  1603.           Uses Crt, FastTTT, DOS, WinTTT.
  1604.  
  1605.           Remarks   If you have restored a screen using RestoreScreen and you no
  1606.                     longer need the saved screen image, call this procedure to
  1607.                     trash the saved image and free the heap space for re-use by
  1608.                     the program
  1609.                     
  1610.                     The Toolkit uses the Turbo Pascal procedures Getmem and
  1611.                     Freemem. You should not use the conflicting Mark and Release
  1612.                     heap management procedures anywhere in your program.
  1613.  
  1614.           See also  SaveScreen, RestoreScreen.
  1615.  
  1616.           Example
  1617.  
  1618.  
  1619.                     USES CRT, FASTTTT, DOS, WINTTT;
  1620.                     BEGIN
  1621.                         SAVESCREEN(1);
  1622.                         ....
  1623.                         . . . {SOME OTHER PROCEDURES THAT CHANGE THE SCREEN}
  1624.                         ....
  1625.                         RESTORESCREEN(1);
  1626.                         DISPOSESCREEN(1);
  1627.                     END.
  1628.           
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.      FillScreen                                                      WinTTT
  1658.      
  1659.  
  1660.  
  1661.      Purpose   To fill part or all of the screen with a specific character.
  1662.  
  1663.      Declaration    FillScreen(X1,Y1,X2,Y2,F,B:integer; C:char);
  1664.                
  1665.                X1 is the top left X coordinate (1..80)
  1666.                Y1 is the top left Y coordinate (1..25)
  1667.                X2 is the lower X coordinate (1..80)
  1668.                Y2 is the lower Y coordinate (1..25)
  1669.                F is the foreground color (0..15)
  1670.                B is the background color (0..15)
  1671.                C is the character (any displayable ASCII character)
  1672.  
  1673.      Uses Crt, FastTTT, DOS, WinTTT.
  1674.  
  1675.      Remarks   This procedure provides a very fast way of filling the
  1676.                screen with a specific character. It is useful for creating
  1677.                interesting backgrounds for menus and the like.
  1678.                
  1679.                Use the procedure ClearText to clear a portion of the
  1680.                screen.
  1681.  
  1682.      See also  ClearText
  1683.  
  1684.      Example
  1685.  
  1686.  
  1687.                USES CRT, FASTTTT, DOS, WINTTT;
  1688.                BEGIN
  1689.                    FILLSCREEN(1,1,80,25,CYAN,BLACK,CHR(177);
  1690.                END.
  1691.      
  1692.  
  1693.      The whole screen is filled with the ASCII character 177. It gives a
  1694.      blocked stipple effect. See the MenuDem.pas program on the
  1695.      distribution disk for a visual example.
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.           FindCursor                                                      WinTTT
  1724.           
  1725.  
  1726.  
  1727.           Purpose   To return the location and size of the cursor.
  1728.  
  1729.           Declaration    FindCursor(var X,Y,ScanTop,ScanBot: byte);
  1730.                     
  1731.                     X is the X coord of the cursor (1..80)
  1732.                     Y is the Y coord of the cursor (1..25)
  1733.                     Scantop is the top scan line of the cursor
  1734.                     ScanBot is the bottom scan line of the cursor
  1735.  
  1736.           Uses Crt, FastTTT, DOS, WinTTT.
  1737.  
  1738.           Remarks.  This procedure is called by many of the screen saving
  1739.                     procedures.
  1740.                     
  1741.                     The four parameters must be variables, and they are returned
  1742.                     with the cursor details.
  1743.                     
  1744.                     The scan codes refer to the actual location of the top and
  1745.                     bottom of the cursor within a character field, where zero is
  1746.                     the top of the field (such as the top stroke of the letter T
  1747.                     -- got it?), and either 13 or 7 is the bottom of the field
  1748.                     on monochrome or color machines respectively.
  1749.  
  1750.           See also  SizeCursor, OnCursor, OffCursor, HalfCursor, FullCursor.
  1751.  
  1752.           Example
  1753.  
  1754.  
  1755.                     USES CRT, FASTTTT, DOS, WINTTT
  1756.                     VAR ROW,COL,TOP,BOT: BYTE;
  1757.                     BEGIN
  1758.                         FINDCURSOR(COL,ROW,TOP,BOT);
  1759.                     END.
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.      FullCursor                                                      WinTTT
  1790.      
  1791.  
  1792.  
  1793.      Purpose   To change the text cursor to a full block.
  1794.  
  1795.      Declaration    FullCursor;
  1796.  
  1797.      Uses Crt, FastTTT, DOS, WinTTT.
  1798.  
  1799.      Remarks   This procedure automatically sets the cursor on monochrome
  1800.                and color systems.
  1801.  
  1802.      See also  SizeCursor, HalfCursor, Oncursor, Offcursor.
  1803.  
  1804.      Example
  1805.  
  1806.  
  1807.                USES CRT, FASTTTT, DOS, WINTTT;
  1808.                BEGIN
  1809.                    FULLCURSOR;
  1810.                END.
  1811.      
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.           GrowMkWin                                                       WinTTT
  1856.           
  1857.  
  1858.  
  1859.           Purpose   To create a text window on the screen and saves the screen
  1860.                     contents that has been overlayed. This procedure is the
  1861.                     functional equivalent of MkWin, except that the window box
  1862.                     explodes onto the screen.
  1863.  
  1864.           Declaration    GrowMkWin(X1,Y1,X2,Y2,F,B,Boxtype: integer);
  1865.                     
  1866.                     X1 is the top left X coordinate (1..80)
  1867.                     Y1 is the top left Y coordinate (1..25)
  1868.                     X2 is the lower X coordinate (1..80)
  1869.                     Y2 is the lower Y coordinate (1..25)
  1870.                     F is the foreground color (0..15)
  1871.                     B is the background color (0..15)
  1872.                     BoxType is the window box line type (see remarks)
  1873.  
  1874.           Uses Crt, FastTTT, DOS, WinTTT.
  1875.  
  1876.           Remarks   The specifications are the same as for GrowFBox.
  1877.                     
  1878.                     The normal values for the Boxtype are:
  1879.                          1    Single line
  1880.                          2    Double line
  1881.                          3    Single top/bottom, double sides
  1882.                          4    Double top/bottom, single sides
  1883.                     
  1884.                     If a BoxType of 0 is passed, the procedure will use a space
  1885.                     (' ') as the box character. If any other number (i.e.
  1886.                     5..256) is used, the box is drawn using the ascii character
  1887.                     represented by the number. Refer to page 568 of the Turbo
  1888.                     Pascal Owner's Handbook to see the ascii table.
  1889.                     
  1890.                     If the box grows too quickly or too slowly, alter the global
  1891.                     variable Speed. The default value is 200; increase the value
  1892.                     to slow the speed down, or decrease it to speed the box up.
  1893.  
  1894.           See also  Mkwin, RmWin
  1895.  
  1896.           Example
  1897.  
  1898.  
  1899.                     USES CRT, FASTTTT, DOS, WINTTT;
  1900.                     BEGIN
  1901.                         SPEED := 400;
  1902.                         GROWMKWIN(1,1,80,12,WHITE,RED,1);
  1903.                     END.
  1904.           
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.      HalfCursor                                                      WinTTT
  1922.      
  1923.  
  1924.  
  1925.      Purpose   To make the text cursor into a half block.
  1926.  
  1927.      Declaration    HalfCursor;
  1928.  
  1929.      Uses Crt, FastTTT, DOS, WinTTT.
  1930.  
  1931.      Remarks   This procedure automatically sets the cursor on monochrome
  1932.                and color systems.
  1933.  
  1934.      See also  SizeCursor, FullCursor, Oncursor, Offcursor.
  1935.  
  1936.      Example
  1937.  
  1938.  
  1939.                USES CRT, FASTTTT, DOS, WINTTT;
  1940.                BEGIN
  1941.                    HALFCURSOR;
  1942.                END.
  1943.      
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.           MkWin                                                           WinTTT
  1988.           
  1989.  
  1990.  
  1991.           Purpose   To create a text window on the screen and save the screen
  1992.                     contents that has been overlayed.
  1993.  
  1994.           Declaration    MkWin(X1,Y1,X2,Y2,F,B,Boxtype: integer);
  1995.                     
  1996.                     X1 is the top left X coordinate (1..80)
  1997.                     Y1 is the top left Y coordinate (1..25)
  1998.                     X2 is the lower X coordinate (1..80)
  1999.                     Y2 is the lower Y coordinate (1..25)
  2000.                     F is the foreground color (0..15)
  2001.                     B is the background color (0..15)
  2002.                     BoxType is the window box line type (see remarks)
  2003.  
  2004.           Uses Crt, FastTTT, DOS, WinTTT.
  2005.  
  2006.           Remarks   The specifications are the same as for FBox.
  2007.                     
  2008.                     The normal values for the Boxtype are:
  2009.                          1    Single line
  2010.                          2    Double line
  2011.                          3    Single top/bottom, double sides
  2012.                          4    Double top/bottom, single sides
  2013.                     
  2014.                     If a BoxType of 0 is passed, the procedure will use a space
  2015.                     (' ') as the box character. If any other number (i.e.
  2016.                     5..256) is used the box is drawn using the ascii character
  2017.                     represented by the number. Refer to page 568 of the Turbo
  2018.                     Pascal Owner's Handbook to see the ascii table.
  2019.                     
  2020.                     If the box grows too quickly or too slowly, alter the global
  2021.                     variable Speed. The default value is 200; increase the value
  2022.                     to slow the speed down, or decrease it to speed the box up.
  2023.  
  2024.           See also  GrowMkWin, RmWin
  2025.  
  2026.           Example
  2027.  
  2028.  
  2029.                     USES CRT, FASTTTT, DOS, WINTTT;
  2030.                     BEGIN
  2031.                         SPEED := 400;
  2032.                         MKWIN(1,1,80,12,WHITE,RED,1);
  2033.                     END.
  2034.           
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.      MoveScreenBlock                                                 WinTTT
  2054.      
  2055.  
  2056.  
  2057.      Purpose   To move one part of the screen to another area of the
  2058.                display.
  2059.  
  2060.      Declaration    MoveScreenBlock(X1,Y1,X2,Y2,X,Y:integer);
  2061.                
  2062.                X1 is the top left X coordinate (1..80)
  2063.                Y1 is the top left Y coordinate (1..25)
  2064.                X2 is the lower X coordinate (1..80)
  2065.                Y2 is the lower Y coordinate (1..25)
  2066.                X is the top left X coord of the target location (1..80)
  2067.                Y is the top left Y coord of the target location (1..25)
  2068.  
  2069.      Uses Crt, FastTTT, DOS, WinTTT.
  2070.  
  2071.      Remarks   The data is moved to another location on the screen and the
  2072.                original source area is blanked out. Use CopyScreenBlock to
  2073.                leave the source area in tact.
  2074.  
  2075.      See Also  CopyScreenBlock.
  2076.  
  2077.      Example
  2078.  
  2079.  
  2080.                USES CRT, FASTTTT, DOS, WINTTT;
  2081.                BEGIN
  2082.                    COPYSCREENBLOCK(1,1,40,25,41,1);
  2083.                END.
  2084.      
  2085.  
  2086.      The left half of the screen is moved over to the right side.
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.           OffCursor                                                       WinTTT
  2120.           
  2121.  
  2122.  
  2123.           Purpose   To make the text cursor disappear.
  2124.  
  2125.           Declaration    OffCursor;
  2126.  
  2127.           Uses Crt, FastTTT, DOS, WinTTT.
  2128.  
  2129.           Remarks   This procedure automatically hides the cursor on monochrome
  2130.                     and color systems.
  2131.  
  2132.           See also  SizeCursor, HalfCursor, Oncursor, Fullcursor.
  2133.  
  2134.           Example
  2135.  
  2136.  
  2137.                     USES CRT, FASTTTT, DOS, WINTTT;
  2138.                     BEGIN
  2139.                         OFFCURSOR;
  2140.                     END.
  2141.           
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.      OnCursor                                                        WinTTT
  2186.      
  2187.  
  2188.  
  2189.      Purpose   To make the text cursor appear in the normal DOS shape.
  2190.  
  2191.      Declaration    OnCursor;
  2192.  
  2193.      Uses Crt, FastTTT, DOS, WinTTT.
  2194.  
  2195.      Remarks   This procedure automatically displays the cursor on
  2196.                monochrome and color systems.
  2197.  
  2198.      See also  SizeCursor, HalfCursor, Offursor, Fullcursor.
  2199.  
  2200.      Example
  2201.  
  2202.  
  2203.                USES CRT, FASTTTT, DOS, WINTTT;
  2204.                BEGIN
  2205.                    ONCURSOR;
  2206.                END.
  2207.      
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.           PartRestore                                                     WinTTT
  2252.           
  2253.  
  2254.  
  2255.           Purpose   To transfer data from a variable to a screen location.
  2256.  
  2257.           Declaration    PartRestore(X1,Y1,X2,Y2: byte;var Source);
  2258.  
  2259.           Uses Crt, FastTTT, DOS, WinTTT.
  2260.  
  2261.           Remarks   This procedure is used internally by the Toolkit.
  2262.  
  2263.           See also  PartRestoreScreen, RestoreScreen, PartSave.
  2264.  
  2265.           
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.      PartRestoreScreen                                               WinTTT
  2318.      
  2319.  
  2320.  
  2321.      Purpose   To restore a portion of a saved screen to the display.
  2322.  
  2323.      Declaration    PartRestoreScreen(Page,X1,Y1,X2,Y2,X,Y: integer);
  2324.                
  2325.                Page is the number of the saved screen
  2326.                X1 is the top left X coord of saved screen (1..80)
  2327.                Y1 is the top left Y coord of saved screen  (1..25)
  2328.                X2 is the lower X coord of saved screen (1..80)
  2329.                Y2 is the lower Y coord of saved screen (1..25)
  2330.                X is the top left X coord of the target location (1..80)
  2331.                Y is the top left Y coord of the target location (1..25)
  2332.  
  2333.      Uses CRT, FastTTT, DOS, WinTTT.
  2334.  
  2335.      Remarks   The procedure is used to restore part of a screen that was
  2336.                previously saved with SaveScreen. The first four coord.
  2337.                parameters indicate which part of the saved screen should be
  2338.                restored, and the last pair of coords indicate the position
  2339.                on the screen where the top left corner of the restored data
  2340.                is located.
  2341.  
  2342.      Example
  2343.  
  2344.  
  2345.                USES CRT, FASTTTT, DOS, WINTTT;
  2346.                BEGIN
  2347.                    SAVESCREEN(1);
  2348.                    .....
  2349.                    ..    {SCREEN MODIFYING PROCEDURES}
  2350.                    .....
  2351.                    PARTRESTORESCREEN(1,1,1,80,12,1,13);
  2352.                    DISPOSESCREEN(1);
  2353.                END.
  2354.      
  2355.  
  2356.      In this example, the screen is saved (let's assume there was something
  2357.      meaningful on the screen at that point), then some other procedures
  2358.      modify the screen display. The top half of the saved screen is then
  2359.      restored to the lower half of the screen display.
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.           PartSave                                                        WinTTT
  2384.           
  2385.  
  2386.  
  2387.           Purpose   To transfer data from the screen to a variable.
  2388.  
  2389.           Declaration    PartSave(X1,Y1,X2,Y2: byte;var Dest);
  2390.  
  2391.           Uses Crt, FastTTT, DOS, WinTTT.
  2392.  
  2393.           Remarks   This procedure is used internally by the Toolkit.
  2394.  
  2395.           See also  SaveScreen.
  2396.  
  2397.           
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.      RestoreScreen                                                   WinTTT
  2450.      
  2451.  
  2452.  
  2453.      Purpose   To restore a previously saved screen.
  2454.  
  2455.      Declaration    RestoreScreen(Page: byte);
  2456.                
  2457.                Page is the number of the previously saved screen
  2458.  
  2459.      Uses Crt, FastTTT, DOS, WinTTT.
  2460.  
  2461.      Remarks   Only use a page number of a screen that was specified with a
  2462.                previous SaveScreen, otherwise unpredictable results will
  2463.                occur e.g. flashing happy faces.
  2464.                
  2465.                RestoreScreen will return the cursor to the position it was
  2466.                at immediately prior to the corresponding SaveScreen.
  2467.  
  2468.      See also  SaveScreen, DisposeScreen, SlideRestoreScreen.
  2469.  
  2470.      Example
  2471.  
  2472.  
  2473.                USES CRT, FASTTTT, DOS, WINTTT;
  2474.                BEGIN
  2475.                    SAVESCREEN(1);
  2476.                    .....
  2477.                    ..    {SCREEN MODIFYING PROCEDURES}
  2478.                    .....
  2479.                    RESTORESCREEN(1);
  2480.                    DISPOSESCREEN(1);
  2481.                END.
  2482.      
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.           RmWin                                                           WinTTT
  2516.           
  2517.  
  2518.  
  2519.           Purpose   To remove a window and restore the original screen contents.
  2520.  
  2521.           Declaration    RmWin;
  2522.  
  2523.           Uses Crt, FastTTT, DOS, WinTTT.
  2524.  
  2525.           Remarks   The RmWin procedure removes the last displayed window.
  2526.                     Successive RmWin statements will remove the earlier
  2527.                     displayed windows. If RmWin is called when there are no
  2528.                     windows, the procedure simplr returns i.e. no problem.
  2529.                     
  2530.                     The windows are always removed in reverse order e.g. you
  2531.                     cannot create 3 windows in succession and then try to remove
  2532.                     the second window without first removing the third one.
  2533.  
  2534.           See also  MkWin.
  2535.  
  2536.           Example
  2537.  
  2538.  
  2539.                     USES CRT, FASTTTT, DOS, WINTTT;
  2540.                     VAR CH : CHAR;
  2541.                     BEGIN
  2542.                         MKWIN(25,20,65,25,WHITE,RED,1);
  2543.                         WRITEBETWEEN(25,65,23,WHITE,RED,'DO YOU WANT TO EXIT
  2544.                     (Y/N)?');
  2545.                         CH := GETKEY;
  2546.                         IF UPCASE(CH) = 'Y' THEN
  2547.                            HALT
  2548.                         ELSE
  2549.                            RMWIN;
  2550.                     END.
  2551.           
  2552.  
  2553.           The above program paints a red window with a white single line border
  2554.           on the last five lines of the screen, and displays a message in the
  2555.           center of the box. If the user responds Y then the program terminates,
  2556.           otherwise the window is removed and the program continues.
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.      SaveScreen                                                      WinTTT
  2582.      
  2583.  
  2584.  
  2585.      Purpose   To save a screen for subsequent restore.
  2586.  
  2587.      Declaration    SaveScreen(Page: byte);
  2588.                
  2589.                Page is the number assigned to the saved screen
  2590.  
  2591.      Uses Crt, FastTTT, DOS, WinTTT.
  2592.  
  2593.      Remarks   This procedure will save a full copy of the screen and all
  2594.                the attributes i.e. the colors. The location of the cursor
  2595.                is also saved.
  2596.                
  2597.                Multiple screens can be saved (up to Max_Screens, see
  2598.                Interface Declarations at beginning of chapter) at the same
  2599.                time. The Page number assignment can be arbitrary, but it is
  2600.                good practice to save them in ascending order starting from
  2601.                page 1. If a page is already saved to a particular Page and
  2602.                another screen is saved to that same Page, the saved screen
  2603.                will be overwritten.
  2604.  
  2605.      See also  RestoreScreen, DisposeScreen, SlideRestoreScreen.
  2606.  
  2607.      Example
  2608.  
  2609.  
  2610.                USES CRT, FASTTTT, DOS, WINTTT;
  2611.                BEGIN
  2612.                    SAVESCREEN(1);
  2613.                    .....
  2614.                    ..    {SCREEN MODIFYING PROCEDURES}
  2615.                    .....
  2616.                    RESTORESCREEN(1);
  2617.                    DISPOSESCREEN(1);
  2618.                END.
  2619.      
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.           ScrollUp                                                        WinTTT
  2648.           
  2649.  
  2650.  
  2651.           Purpose   To scroll all or part of the screen upward one line.
  2652.  
  2653.           Declaration    ScrollUp(X1,Y1,X2,Y2:integer);
  2654.                     
  2655.                     X1 is the top left X coordinate (1..80)
  2656.                     Y1 is the top left Y coordinate (1..25)
  2657.                     X2 is the lower X coordinate (1..80)
  2658.                     Y2 is the lower Y coordinate (1..25)
  2659.                     
  2660.  
  2661.           Uses Crt, FastTTT, DOS, WinTTT.
  2662.  
  2663.           Remarks   All the text is moved up one line and the lower line is
  2664.                     replaced with with blanks.
  2665.                     
  2666.                     The characters and their color attributes are scrolled.
  2667.  
  2668.           See also  CopyScreenBlock, MoveScreenBlock.
  2669.  
  2670.           Example
  2671.  
  2672.  
  2673.                     USES CRT, FASTTTT, DOS, WINTTT;
  2674.                     BEGIN
  2675.                         SCROLLUP(10,1,70,5);
  2676.                     END.
  2677.           
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.      SizeCursor                                                      WinTTT
  2714.      
  2715.  
  2716.  
  2717.      Purpose   To change the cursor shape/appearance.
  2718.  
  2719.      Declaration    SizeCursor(ScanTop,ScanBot: byte);
  2720.                
  2721.                Scantop is the top scan line of the cursor
  2722.                ScanBot is the bottom scan line of the cursor
  2723.  
  2724.      Uses Crt, FastTTT, DOS, WinTTT.
  2725.  
  2726.      Remarks.  This procedure is called by OnCursor, OffCursor, HalfCursor
  2727.                and FullCursor, and these other procedures should normally
  2728.                be used in preference to SizeCursor because they
  2729.                automatically accommodate monochrome and color systems.
  2730.                
  2731.                The scan codes refer to the actual location of the top and
  2732.                bottom of the cursor within a character field, where zero is
  2733.                the top of the field (such as the top stroke of the letter T
  2734.                -- got it?), and either 13 or 7 is the bottom of the field
  2735.                on monochrome or color machines respectively.
  2736.                
  2737.                The cursor can be hidden by setting the top scan line to 14
  2738.                -- see OffCursor.
  2739.  
  2740.      See also  FindCursor, OnCursor, OffCursor, HalfCursor, FullCursor.
  2741.  
  2742.      Example
  2743.  
  2744.  
  2745.                USES CRT, FASTTTT, DOS, WINTTT;
  2746.                BEGIN
  2747.                    IF BASEOFSCREEN = $B800 THEN
  2748.                       SIZECURSOR(5,7)
  2749.                    ELSE
  2750.                       SIZECURSOR(9,13);
  2751.                END.
  2752.      
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.           SlideRestoreScreen                                              WinTTT
  2780.           
  2781.  
  2782.  
  2783.           Purpose   To restore a previously saved screen. This procedure is the
  2784.                     functional equivalent of RestoreScreen except that the text
  2785.                     s..l...i...d....e.....s onto the screen
  2786.  
  2787.           Declaration    SlideRestoreScreen(Page: byte; Way: direction);
  2788.                     
  2789.                     Page is the number of the previously saved screen
  2790.                     Way is the direction to slide i.e. up, down, left or right
  2791.                     
  2792.  
  2793.           Uses Crt, FastTTT, DOS, WinTTT.
  2794.  
  2795.           Remarks   Only use a page number of a screen that was specified with a
  2796.                     previous SaveScreen, otherwise unpredictable results will
  2797.                     occur e.g. flashing happy faces.
  2798.                     
  2799.                     RestoreScreen will return the cursor to the position it was
  2800.                     at immediately prior to the corresponding SaveScreen.
  2801.  
  2802.           See also  SaveScreen, DisposeScreen, RestoreScreen.
  2803.  
  2804.           Example
  2805.  
  2806.  
  2807.                     USES CRT, FASTTTT, DOS, WINTTT;
  2808.                     BEGIN
  2809.                         SAVESCREEN(1);
  2810.                         .....
  2811.                         ..    {SCREEN MODIFYING PROCEDURES}
  2812.                         .....
  2813.                         SLIDERESTORESCREEN(1,DOWN);
  2814.                         DISPOSESCREEN(1);
  2815.                     END.
  2816.           
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.      TempMessage                                                     WinTTT
  2846.      
  2847.  
  2848.  
  2849.      Purpose   To display a message anywhere on the screen, wait for a
  2850.                keypress (or mouse activity), and then restore the original
  2851.                screen contents.
  2852.  
  2853.      Declaration    TempMessage(X,Y,F,B: integer; St: string);
  2854.                
  2855.                X is the X coord of the first character (1..80)
  2856.                Y is the Y coordinate or display line (1..25)
  2857.                F is the foreground color (0..15)
  2858.                B is the background color (0..15)
  2859.                St is the string or message text
  2860.  
  2861.      Uses Crt, FastTTT, DOS, WinTTT.
  2862.  
  2863.      Remarks   The procedure temporarily stores the line of text together
  2864.                with its color attributes. It  displays the temporary
  2865.                message, and after a key is pressed (any key, or any mouse
  2866.                activity), the original text and color attributes are
  2867.                restored to the screen.
  2868.                
  2869.                Note that the procedure does not return which key was
  2870.                pressed.
  2871.                
  2872.                This is one of the most popular procedures in the Toolkit
  2873.                and is most useful when the screen is very busy and you want
  2874.                to display an error or warning message without modifying the
  2875.                display.
  2876.                
  2877.  
  2878.      Example
  2879.  
  2880.  
  2881.                USES CRT, FASTTTT, DOS, WINTTT;
  2882.                BEGIN
  2883.                    TEMPMESSAGE(1,1,YELLOW,RED,'YOU CANNOT REFORMAT THE
  2884.                NETWORK!');
  2885.                END.
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.           Confine_Mouse_Horiz                                             KeyTTT
  2912.           
  2913.  
  2914.  
  2915.           Purpose   To restrict the screen position of the mouse cursor
  2916.                     horizontally.
  2917.  
  2918.           Declaration    Confine_Mouse_Horiz(Left,Right: integer);
  2919.                     
  2920.                     Left is the left most X coord (1..80)
  2921.                     Right is the right most X coord (1..80)
  2922.  
  2923.           Uses CRT, DOS, KeyTTT.
  2924.  
  2925.           Remarks   If the mouse is outside the confined coords when the
  2926.                     restrictions are made, the mouse is repositioned inside the
  2927.                     nearest boundary, as soon as any mouse activity occurs .
  2928.  
  2929.           See also  Confine_Mouse_Vert.
  2930.  
  2931.           Example   
  2932.  
  2933.  
  2934.                     USES CRT, DOS, KEYTTT;
  2935.                     BEGIN
  2936.                         HIDE_MOUSE_CURSOR;
  2937.                         CONFINE_MOUSE_HORIZ(20,60);
  2938.                         SHOW_MOUSE_CURSOR;
  2939.                     END.
  2940.           
  2941.  
  2942.           The mouse is resticted to movement between columns 20 and 60.
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.      Confine_Mouse_Vert                                              KeyTTT
  2978.      
  2979.  
  2980.  
  2981.      Purpose   To restrict the screen position of the mouse cursor
  2982.                vertically.
  2983.  
  2984.      Declaration    Confine_Mouse_Vert(Top,Bot: integer);
  2985.                
  2986.                Top is the upper most Y coord (1..25)
  2987.                Bot is the lower most Y coord (1..25)
  2988.  
  2989.      Uses CRT, DOS, KeyTTT;
  2990.  
  2991.      Remarks   If the mouse is outside the confined coords, then as soon as
  2992.                any mouse activity occurs (or a mouse function is called)
  2993.                the mouse is repositioned inside the nearest boundary.
  2994.  
  2995.      See also  Confine_Mouse_Horiz.
  2996.  
  2997.      Example
  2998.  
  2999.  
  3000.                USES CRT, DOS, KEYTTT;
  3001.                BEGIN
  3002.                    HIDE_MOUSE_CURSOR;
  3003.                    CONFINE_MOUSE_HORIZ(20,60);
  3004.                    CONFINE_MOUSE_VERT(5,15);
  3005.                    SHOW_MOUSE_CURSOR;
  3006.                END.
  3007.      
  3008.  
  3009.      The mouse is resticted to movement between columns 20 to 60, and
  3010.      between rows 5 to 15.
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.           DelayKey                                                        KeyTTT
  3044.           
  3045.  
  3046.  
  3047.           Purpose   To pause while user presses key or a specified time period
  3048.                     elapses.
  3049.  
  3050.           Declaration    DelayKey(Time: integer);
  3051.                     
  3052.                     Time is the maximum pause in seconds.
  3053.  
  3054.           Uses CRT, DOS, KeyTTT.
  3055.  
  3056.           Remarks   This is one of my favorites. The system pauses until a key
  3057.                     is pressed or, if a key isn't pressed, until a specified
  3058.                     time has elapsed.
  3059.                     
  3060.                     Very useful for temporarily displaying messages, copyright
  3061.                     screens etc. As soon as the user presses a key (or there is
  3062.                     mouse activity) the procedure ends.
  3063.  
  3064.           See also  GetKey.
  3065.  
  3066.           Example
  3067.  
  3068.  
  3069.                     USES CRT, DOS, KEYTTT;
  3070.                     BEGIN
  3071.                         DISPLAY_HELP;      {SOME EARLIER DEFINED PROCEDURE}
  3072.                         DELAYKEY(5);
  3073.                         CLRSCR;
  3074.                     END.
  3075.           
  3076.  
  3077.           A help screen is displayed for up to 5 seconds or until a key is
  3078.           pressed.
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.      GetKey                                                          KeyTTT
  3110.      
  3111.  
  3112.  
  3113.      Purpose   To read a character from the keyboard.
  3114.  
  3115.      Declaration    GetKey:char;
  3116.  
  3117.      Returns   Char
  3118.  
  3119.      Uses CRT, DOS, KeyTTT.
  3120.  
  3121.      Remarks   This is the main function in the KeyTTT unit and is called
  3122.                throughout the Toolkit.
  3123.                
  3124.                This is a fully functional replacement for Turbo's internal
  3125.                ReadKey command. Refer to Appendix B for a full list of all
  3126.                the character codes that are returned.
  3127.  
  3128.      See also  Delay_Key.
  3129.  
  3130.      Example
  3131.  
  3132.  
  3133.                USES CRT, FASTTTT, DOS, KEYTTT;
  3134.                VAR CH : CHAR;
  3135.                BEGIN
  3136.                    WRITECENTER(25,LIGHTCYAN,BLUE,'PRESS F10 TO CONTINUE');
  3137.                    CH := GETKEY;
  3138.                    IF CH <> #196 THEN
  3139.                       HALT;
  3140.                END.
  3141.      
  3142.  
  3143.      The code for F10 is #196, see appendix B.
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.           Get_Mouse_Action                                                KeyTTT
  3176.           
  3177.  
  3178.  
  3179.           Purpose   Determine mouse activity i.e. movement and button presses.
  3180.  
  3181.           Declaration    Get_Mouse_Action(var But:button; var Hor, Ver:
  3182.                     integer);
  3183.                     
  3184.                     But is retuned with one of NoB, LeftB, RightB, BothB
  3185.                     Hor and Ver return the horizontal and vertical movement
  3186.  
  3187.           Uses CRT, DOS, KeyTTT.
  3188.  
  3189.           Remarks   This procedure is designed for internal use and is called by
  3190.                     GetKey.
  3191.                     
  3192.                     The Hor & Ver variables return the movement in cols and rows
  3193.                     not pixels i.e. Pixel div 8. The movement is returned
  3194.                     relative to the position of the mouse the last time the
  3195.                     procedure was called.
  3196.  
  3197.           Example
  3198.  
  3199.  
  3200.                     USES CRT, DOS, KEYTTT;
  3201.                     VAR
  3202.                       B : BUTTON;
  3203.                       X,Y : INTEGER;
  3204.                     BEGIN
  3205.                         REPEAT
  3206.                              GET_MOUSE_ACTION(B,X,Y);
  3207.                         UNTIL B = LEFTB;
  3208.                     END.
  3209.                     
  3210.           
  3211.  
  3212.           This program continues looping until the left mouse button is pressed.
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.      Hide_Mouse_Cursor                                               KeyTTT
  3242.      
  3243.  
  3244.  
  3245.      Purpose   To hide the mouse cursor from view!
  3246.  
  3247.      Declaration    Hide_Mouse_Cursor;
  3248.  
  3249.      Uses CRT, DOS, KeyTTT.
  3250.  
  3251.      Remarks   The mouse cursor is set on with the Show_Mouse_Cursor
  3252.                procedure.
  3253.                
  3254.                The normal text Cursor is not affected by this procedure,
  3255.                and the OffCursor procedure should also be called to turn it
  3256.                off.
  3257.  
  3258.      See also  Show_Mouse_Cursor.
  3259.  
  3260.      Example
  3261.  
  3262.  
  3263.                USES CRT, DOS, KEYTTT;
  3264.                BEGIN
  3265.                    HIDE_MOUSE_CURSOR;
  3266.                END.
  3267.      
  3268.  
  3269.      See the file MouseDem.pas on the distribution disk for a more detailed
  3270.      example.
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.           Mouse_Installed                                                 KeyTTT
  3308.           
  3309.  
  3310.  
  3311.           Purpose   To indicate if a Microsoft compatible mouse is installed.
  3312.  
  3313.           Declaration    Mouse_Installed:boolean;
  3314.  
  3315.           Returns   Boolean;
  3316.  
  3317.           Uses CRT, DOS, KeyTTT.
  3318.  
  3319.           Remarks   This procedure is automatically called (if you include the
  3320.                     KeyTTT unit in your program) and it updates the global
  3321.                     variable Moused.
  3322.  
  3323.           Example
  3324.  
  3325.  
  3326.                     USES CRT, DOS, KEYTTT;
  3327.                     BEGIN
  3328.                         IF NOT MOUSE_INSTALLED THEN HALT;
  3329.                     END.
  3330.           
  3331.  
  3332.           See the file MouseDem.pas on the distribution disk for a more detailed
  3333.           example.
  3334.  
  3335.           
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.      Move_Mouse                                                      KeyTTT
  3374.      
  3375.  
  3376.  
  3377.      Purpose   To reposition the mouse cursor.
  3378.  
  3379.      Declaration    Move_Mouse(Hor,Ver:integer);
  3380.                
  3381.                Hor is the X coordinate (1..80)
  3382.                Ver is the Y coordinate (1..25)
  3383.  
  3384.      Uses CRT, DOS, KeyTTT.
  3385.  
  3386.      Remarks   This procedure is the functional equivalent of GotoXY for
  3387.                the text cursor.
  3388.  
  3389.      See also  Confine_Mouse_Horiz, Confine_Mouse_Vert.
  3390.  
  3391.      Example
  3392.  
  3393.  
  3394.                USES CRT, DOS, KEYTTT;
  3395.                BEGIN
  3396.                    MOVE_MOUSE(40,13);
  3397.                END.
  3398.      
  3399.  
  3400.      The mouse cursor is moved to the center of the display. See the file
  3401.      MouseDem.pas on the distribution disk for a more detailed example.
  3402.  
  3403.      
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.           Set_Mouse_Cursor_Style                                          KeyTTT
  3440.           
  3441.  
  3442.  
  3443.           Purpose   To change the appearance of the mouse cursor.
  3444.  
  3445.           Declaration    Set_Mouse_Cursor_Style(OrdChar:integer);
  3446.                     
  3447.                     OrdChar is the ASCII code for the desired cursor character.
  3448.  
  3449.           Uses CRT, DOS, KeyTTT.
  3450.  
  3451.           Remarks   In text mode the shape of the mouse cursor can be any of the
  3452.                     displayable ASCII characters - you can even make the cursor
  3453.                     the letter 'C' if you feel so inclined!
  3454.                     
  3455.                     The default cursor is a small rectangle. Once the cursor
  3456.                     style has been modified, it will assume the new style until
  3457.                     the mouse is re-installed (usually from a reboot), or until
  3458.                     this procedure changes it again.
  3459.                     
  3460.                     Refer to page 568 of the Turbo Pascal Owner's Handbook for a
  3461.                     list of the ASCII characters and codes.
  3462.  
  3463.           See also  Show_Mouse_Cursor.
  3464.  
  3465.           Example
  3466.  
  3467.  
  3468.                     USES CRT, DOS, KEYTTT;
  3469.                     BEGIN
  3470.                         SET_MOUSE_CURSOR_STYLE(29);
  3471.                     END.
  3472.           
  3473.  
  3474.           The cursor is changed to a double headed arrow.
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.      Show_Mouse_Cursor                                               KeyTTT
  3506.      
  3507.  
  3508.  
  3509.      Purpose   To reisplay the mouse cursor.
  3510.  
  3511.      Declaration    Show_Mouse_Cursor;
  3512.  
  3513.      Uses CRT, DOS, KeyTTT.
  3514.  
  3515.      Remarks   The mouse cursor is not normally displayed. Use this
  3516.                procedure to display the mouse and use Hide_Mouse_Cursor to
  3517.                turn it off again.
  3518.  
  3519.      See also  Show_Mouse_Cursor, Confine_Mouse_Horiz, Confine_Mouse_Vert.
  3520.  
  3521.      Example
  3522.  
  3523.  
  3524.                USES CRT, DOS, KEYTTT;
  3525.                BEGIN
  3526.                    SHOW_MOUSE_CURSOR;
  3527.                END.
  3528.      
  3529.  
  3530.      See the file MouseDem.pas on the distribution disk for a more detailed
  3531.      example.
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.           IO_AllowEsc                                                      IOTTT
  3572.           
  3573.  
  3574.  
  3575.           Purpose   To indicate if Esc key is operative
  3576.  
  3577.           Type Optional.
  3578.  
  3579.           Declaration    IO_AllowEsc(OK:boolean);
  3580.                     
  3581.                     OK is true if you want to allow the user to ESCape.
  3582.  
  3583.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3584.  
  3585.           Remarks   The default is false, i.e. Esc is in-operative.
  3586.                     
  3587.                     If the user does ESC the return code from IO_Edit is set to
  3588.                     1.
  3589.  
  3590.           Example
  3591.  
  3592.  
  3593.                     USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
  3594.                     BEGIN
  3595.                         IO_ALLOWESC(FALSE);
  3596.                     END.
  3597.           
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.      IO_DefineMsg                                                     IOTTT
  3638.      
  3639.  
  3640.  
  3641.      Purpose   To display a message when the user moves to the specified
  3642.                input field.
  3643.  
  3644.      Type Optional.
  3645.  
  3646.      Declaration    IO_DefineMsg(ID, X, Y:byte;ST : string);
  3647.                
  3648.                ID is the ID number of the input field assigned with this
  3649.                message.
  3650.                X is the X coord of the first char of the message
  3651.                Y is the Y coord or display line of the message
  3652.                ST is the text or message
  3653.  
  3654.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3655.  
  3656.      Remarks   Every input field is assigned an ID in the IO_DefineStr
  3657.                routine.
  3658.                
  3659.                You can display a message when the user moves to any input
  3660.                field. When the user exits the field, the message is removed
  3661.                and the original screen content (which was overlayed by the
  3662.                message) is restored.
  3663.                
  3664.                You can define unique messages for one, some or all of the
  3665.                input fields.
  3666.  
  3667.      Example
  3668.  
  3669.  
  3670.                USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
  3671.                BEGIN
  3672.                    IO_DEFINEMSG(7,1,25,'INPUT THE CHEST MEASUREMENT');
  3673.                END.
  3674.      
  3675.  
  3676.      The message "Input the chest measurement" will be displayed at the
  3677.      bottom left of the screen, whenever the cursor is moved to input field
  3678.      7.
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.           IO_DefineStr                                                     IOTTT
  3704.           
  3705.  
  3706.  
  3707.           Purpose   To define all the characteristics of a specific input field.
  3708.                     This is the major procedure in the IOTTT unit.
  3709.  
  3710.           Type Mandatory
  3711.  
  3712.           Declaration    IO_DefineStr(ID,
  3713.                          U,D,L,R,
  3714.                          X,Y: byte;
  3715.                          var DefString : string;
  3716.                          DefFormat     : string);
  3717.                     
  3718.                     See Remarks.
  3719.  
  3720.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3721.  
  3722.           Remarks   ID is the ID number for this input field. Every field is
  3723.                     assigned an ID number, the same ID number is used by the
  3724.                     IO_DefineMsg procedure. It is logical (but not mandatory) to
  3725.                     start with ID number 1 and increment by one as you define
  3726.                     each field.
  3727.                     
  3728.                     U,D,L,R are four bytes which represent the ID's of the
  3729.                     fields which the cursor should move to if the up, down, left
  3730.                     or right edit keys respectively are pressed, . For example,
  3731.                     5,2,5,2    would state that if the up or left keys are
  3732.                     pressed, the cursor will move to field ID 5, and if the down
  3733.                     or right keys are pressed, the cursor will move to field ID
  3734.                     2. Got it? Note that an ID of zero (0) indicates that the
  3735.                     input session will terminate (as if the End key had been
  3736.                     pressed). This is a useful tool if you want to end a session
  3737.                     after the last field has been updated and the user tries to
  3738.                     move forward to the next input field.
  3739.                     
  3740.                     X,Y simply represent the X and Y coordinates of the first
  3741.                     character in the input field. This is how you tell the
  3742.                     system the location of the field on the screen.
  3743.                     
  3744.                     DefString is a previously declared parameter of type string
  3745.                     which is returned from the IO procedure with the user's
  3746.                     input. If you want to provide the user with a default entry,
  3747.                     then set the value of DefString to the required default
  3748.                     string, otherwise set it to null i.e. ''.
  3749.                     
  3750.                     DefFormat which is the format of the input field (as
  3751.                     discussed previously under the sub-heading FORMATTING).
  3752.  
  3753.           Example   See Major example on page 64.
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.      IO_DisplayFields                                                 IOTTT
  3770.      
  3771.  
  3772.  
  3773.      Purpose   To display the input fields on the screen, prior to input.
  3774.  
  3775.      Type Optional.
  3776.  
  3777.      Declaration    IO_DisplayFields;
  3778.  
  3779.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3780.  
  3781.      Remarks   Normally the fields are not displayed on the screen until
  3782.                the IO_Edit procedure is called. Call this procedure if you
  3783.                want to display the input fields before allowing the user to
  3784.                edit them.
  3785.                
  3786.                This procedure must be preceded by IO_SetFields, and all the
  3787.                IO_DefineStr statements.
  3788.  
  3789.      Example   See Major example on page 64
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.           IO_Edit                                                          IOTTT
  3836.           
  3837.  
  3838.  
  3839.           Purpose   To control user input of data.
  3840.  
  3841.           Type Mandatory.
  3842.  
  3843.           Declaration    IO_Edit(var Retcode: integer);
  3844.                     
  3845.                     Retcode must be an integer variable
  3846.  
  3847.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3848.  
  3849.           Remarks   When you have declared all the parameters and defined all
  3850.                     the IO procedures (including any optional procedures such as
  3851.                     color changes) then you're ready to let the user input and
  3852.                     update the fields. IO_Edit does this and passes control to
  3853.                     the user.
  3854.                     
  3855.                     The procedure returns control to your program when the user
  3856.                     has ended the update session, either by pressing End or Esc
  3857.                     (if it is enabled) or by pressing any of the move to next
  3858.                     field keys (Enter, Tab, etc.) when the next field has been
  3859.                     defined as ID zero.
  3860.                     
  3861.                     The Retcode variable is updated with a return code for the
  3862.                     edit session. The return codes are :
  3863.                     
  3864.                          0 for successful completion
  3865.                          1 if user pressed Esc key
  3866.  
  3867.           Example   See Major example on page 64.
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.      IO_ResetFields                                                   IOTTT
  3902.      
  3903.  
  3904.  
  3905.      Purpose   To dispose of memory used during IO process and reset the
  3906.                input variables to default values.
  3907.  
  3908.      Type Mandatory.
  3909.  
  3910.      Declaration    IO_ResetFields;
  3911.  
  3912.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3913.  
  3914.      Remarks   This procedure is normally the next statement after IO_Edit.
  3915.                It discards all the field definitions from the Heap and sets
  3916.                all the optional settings (such as color) back to the
  3917.                default values.
  3918.  
  3919.      Example   See Major example on page 64
  3920.  
  3921.      
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.           IO_SetColors                                                     IOTTT
  3968.           
  3969.  
  3970.  
  3971.           Purpose   To set the colors to your preferred values. Believe it or
  3972.                     not, some people don't like my choice of colors!
  3973.  
  3974.           Type Optional
  3975.  
  3976.           Declaration    IO_SetColors(HF,HB,LF,LB,MF,MB:byte);
  3977.                     
  3978.                     HF is the foreground color of the active field (0..15)
  3979.                     HB is the background color of the active field (0..7)
  3980.                     LF is the foreground color of the other fields (0..15)
  3981.                     LB is the background color of the other fields (0..7)
  3982.                     MF is the foreground color of the optional message (0..15)
  3983.                     MB is the background color of the optional message (0..15)
  3984.  
  3985.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  3986.  
  3987.           Remarks   The Toolkit will default to one of two sets, depending on
  3988.                     whether the system is monochrome or color.
  3989.  
  3990.           Example
  3991.  
  3992.  
  3993.                     USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
  3994.                     BEGIN
  3995.                         IF BASEOFSCREEN = $B800 THEN
  3996.                            IO_SETCOLORS(YELLOW, RED, BLACK, LIGHTGRAY,
  3997.                     LIGHTCYAN, BLUE);
  3998.                         ELSE
  3999.                            IO_SETCOLORS(WHITE, BLACK, LIGHTGRAY, BLACK, BLACK,
  4000.                     LIGHTGRAY);
  4001.                     END.
  4002.           
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.      IO_SetFields                                                     IOTTT
  4034.      
  4035.  
  4036.  
  4037.      Purpose   Indicates the total number of input fields.
  4038.  
  4039.      Type Mandatory
  4040.  
  4041.      Declaration    IO_SetFields(Tot: integer);
  4042.                
  4043.                Tot is the total number of input fields on the screen.
  4044.  
  4045.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  4046.  
  4047.      Remarks   This procedure must be the first IOTTT procedure. Pass the
  4048.                total number of input fields that will be defined. For
  4049.                example, IO_Setfields(5) advises the system that 5 input
  4050.                fields will be defined on the next input screen.
  4051.                
  4052.                The maximum number of fields is determined by the global
  4053.                constant MaxInputFields, see IOTTT.pas on the distribution
  4054.                disk. This constant may be changed to any desired value in
  4055.                the range 1..2000.
  4056.  
  4057.      Example   See Major example on page 64
  4058.  
  4059.      
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.           IO_SoundBeeper                                                   IOTTT
  4100.           
  4101.  
  4102.  
  4103.           Purpose   To switch the (annoying) beep on or off.
  4104.  
  4105.           Type Optional.
  4106.  
  4107.           Declaration    IO_SoundBeeper(OK:boolean);
  4108.                     
  4109.                     OK is true if you want the system to BEEEP when the user
  4110.                     presses an invalid key.
  4111.  
  4112.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  4113.  
  4114.           Remarks   The default is true, i.e. the system will beep.
  4115.  
  4116.           Example
  4117.  
  4118.  
  4119.                     USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
  4120.                     BEGIN
  4121.                         IO_SOUNDBEEPER(FALSE);
  4122.                     END.
  4123.           
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.      IO_UserHook                                                      IOTTT
  4166.      
  4167.  
  4168.  
  4169.      NOTE This is not a procedure. IO_UserHook is declared as a pointer
  4170.                variable.
  4171.  
  4172.      Purpose   To provide a way of intercepting the input and optionally
  4173.                calling a non-Toolkit procedure, i.e. a special procedure
  4174.                you have written.
  4175.  
  4176.      Type Optional
  4177.  
  4178.      Declaration    IO_UserHook := @Procedure_Name
  4179.                
  4180.                Procedure_name is the actual name of the procedure which is
  4181.                to be called each time a key is pressed.
  4182.  
  4183.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
  4184.  
  4185.      Remarks   The procedure must be declared as follows:
  4186.  
  4187.  
  4188.                {$F+}
  4189.                PROCEDURE_NAME(CH:CHAR; FIELDID: INTEGER; VAR RETURNSTR:
  4190.                STRING);
  4191.                BEGIN
  4192.                .....   {STATEMENTS}
  4193.                END;
  4194.                {$F-}
  4195.      
  4196.  
  4197.           The compiler directives (F and F-) designate the procedure as
  4198.                FAR. The Procedure_Name can be any valid procedure name, and
  4199.                this procedure may call other procedures. The 3 procedure
  4200.                parameters must be defined in the order shown.
  4201.                
  4202.                Ch will be the value of the character input by the user
  4203.                ,refer to appendix B for a list of the codes. Check this
  4204.                variable immediately and EXIT the procedure if it is not one
  4205.                of the special keys you are trying to intercept.
  4206.                
  4207.                FieldID will indicate the ID of the field the user is
  4208.                currently editing.
  4209.                
  4210.                ReturnStr is passed to the procedure with the current field
  4211.                value. You may update this variable to reset the current
  4212.                value of the field.
  4213.  
  4214.      Example   See IOdem.pas on the distribution disk.
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.           ReadLine                                                       ReadTTT
  4232.           
  4233.  
  4234.  
  4235.           Purpose   To provide a line input/editing facility
  4236.  
  4237.           Declaration    ReadLine( X,Y,L,F,B: byte
  4238.                          var Text: string;
  4239.                          var Retcode: string);
  4240.                     
  4241.                     X is the X coord of input field (1..80)
  4242.                     Y is the Y coord of input field (1..25)
  4243.                     L is the length in chars of input field(1..80)
  4244.                     F is the foreground color (0..15)
  4245.                     B is the background color (0..7)
  4246.                     Text is returned with the users input
  4247.                     Retcode indicates if user Escaped.
  4248.  
  4249.           Uses CRT, FastTTT, ReadTTT.
  4250.  
  4251.           Remarks   "Text" must be declared as a string variable. This variable
  4252.                     is returned with the users input. If you want to provide the
  4253.                     user with a default entry, set the value of Text to the
  4254.                     desired default string, otherwise set it to null, i.e. ''.
  4255.                     
  4256.                     "Retcode" must be an integer variable and it is returned
  4257.                     with the following values:
  4258.                          0    successful completion
  4259.                          1    user ESCaped
  4260.  
  4261.           Example
  4262.  
  4263.  
  4264.                     USES CRT, FASTTTT, READTTT;
  4265.                     VAR
  4266.                       THEFILE: STRING;
  4267.                       CODE : INTEGER;
  4268.                     BEGIN
  4269.                         THEFILE := '';
  4270.                         WRITEAT(10,5,WHITE,BLACK,'ENTER THE FILENAME ===>');
  4271.                         REPEAT
  4272.                              READLINE(33,5,12,BLACK,LIGHTGRAY, THEFILE, CODE);
  4273.                         UNTIL CODE = 0;
  4274.                     END.
  4275.           
  4276.  
  4277.           A 12 character field is presented for the user to input a filename. If
  4278.           the user ESCapes, the system will re-prompt for a filename.
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.      DisplayMenu                                                    MenuTTT
  4298.      
  4299.  
  4300.  
  4301.      Purpose   To display a highly formatted menu window.
  4302.  
  4303.      Declaration    Displaymenu(MenuDef: menu_record;
  4304.                     Window: boolean;
  4305.                     var Choice,Retcode: integer);
  4306.                
  4307.                MenuDef - the name of the menu record.
  4308.                
  4309.                Window - when true indicates the screen prior to menu
  4310.                display should be restored after menu completion.
  4311.                
  4312.                Choice is returned with the users menu selection. The
  4313.                variable should be initialized to the menu pick that should
  4314.                be highlighted when the menu is first displayed.
  4315.                
  4316.                Retcode is returned with a value of zero if the execution
  4317.                was successful, or 1 if the user pressed Esc and AllowEsc
  4318.                was enabled.
  4319.  
  4320.      Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, MenuTTT.
  4321.  
  4322.      See also  Pull_menu (discussed in next chapter)
  4323.  
  4324.      Example   See previous page.
  4325.  
  4326.      
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.           
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.      Pull_Menu                                                      PullTTT
  4430.      
  4431.  
  4432.  
  4433.      Purpose   To display a pulldown menu.
  4434.  
  4435.      Declaration    Pull_menu(M: MenuDesc; var PickM, PickS: byte);
  4436.                
  4437.                M is the MenuDesc array containing all the topics
  4438.                
  4439.                PickM is returned with the main heading selected, this is
  4440.                set to 0 if the user pressed Esc and PM.AllowEsc is true.
  4441.                
  4442.                PickS is returned with the sub-topic selected
  4443.  
  4444.      Uses Crt, FastTTT, DOS, WinTTT, KeyTTT, PullTTT.
  4445.  
  4446.      Remarks   Modify the contents of the PM record to alter display
  4447.                format.
  4448.                
  4449.                The PickM and PickS variables should be initialized to the
  4450.                default values that should be highlighted when the menu is
  4451.                first displayed. If PickS is set to 0, the submenu will not
  4452.                be initially displayed.
  4453.  
  4454.      See also  DisplayMenu (discussed in previous Chapter)
  4455.  
  4456.      Example   See Major Example on page 54.
  4457.  
  4458.      
  4459.  
  4460.      
  4461.  
  4462.      
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.           PM_UserHook                                                      IOTTT
  4496.           
  4497.  
  4498.  
  4499.           NOTE This is not a procedure. PM_UserHook is declared as a pointer
  4500.                     variable.
  4501.  
  4502.           Purpose   The PM_UserHook provides a way of intercepting the input and
  4503.                     optionally calling a non-Toolkit procedure, i.e. a special
  4504.                     procedure you have written.
  4505.  
  4506.           Declaration    PM_UserHook := @Procedure_Name
  4507.                     
  4508.                     Procedure_name is the actual name of the procedure which is
  4509.                     to be called each time a key is pressed.
  4510.  
  4511.           Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, PullTTT.
  4512.  
  4513.           Remarks   The procedure must be declared as follows:
  4514.  
  4515.  
  4516.                     {$F+}
  4517.                     PROCEDURE_NAME(VAR CH:CHAR; MAIN, SUB: BYTE);
  4518.                     BEGIN
  4519.                     .....   {STATEMENTS}
  4520.                     END;
  4521.                     {$F-}
  4522.           
  4523.  
  4524.                The compiler directives (F and F-) designate the procedure as
  4525.                     FAR. The Procedure_Name can be any valid procedure name, and
  4526.                     this procedure may call other procedures. The 3 procedure
  4527.                     parameters must be defined in the order shown.
  4528.                     
  4529.                     Ch will be the value of the character input by the user.
  4530.                     Refer to appendix B for a list of the codes. Check this
  4531.                     variable immediately and EXIT the procedure if it is not one
  4532.                     of the special keys you are trying to intercept.
  4533.                     
  4534.                     Main is the number of the main menu currently selected
  4535.                     
  4536.                     Sub is the number of the sub-topic currently selected
  4537.                     
  4538.  
  4539.           Example   See Pulldem.pas on the distribution disk.
  4540.  
  4541.           
  4542.  
  4543.           
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.      Display_Directory                                               DirTTT
  4562.      
  4563.  
  4564.  
  4565.      Purpose   To display a Sidekick-like directory for the user to select
  4566.                a file.
  4567.  
  4568.      Returns   a string containing the selected file.
  4569.  
  4570.      Declaration    Display_Directory(  var PathName: string;
  4571.                          FileMask: string):string;
  4572.                
  4573.                PathName is a string variable containing the directory to
  4574.                initially display.
  4575.                
  4576.                FileMask is a string containing a DOS compatible file mask.
  4577.                The ? and * symbols are supported e.g. '*.pas',
  4578.                '???willy.*'.
  4579.  
  4580.      Remarks   If the D.AllowEsc variable is enabled, then the function
  4581.                returns a string of #027 if the user ESCapes.
  4582.                
  4583.                There is no facility for saving/restoring the screen
  4584.                automatically. If necessary, use the SaveScreen and
  4585.                RestoreScreen procedures included in the WinTTT unit.
  4586.  
  4587.      Example
  4588.  
  4589.  
  4590.                USES CRT, FASTTTT, DOS, KEYTTT, WINTTT, DIRTTT;
  4591.                VAR  F,P : STRING;
  4592.                BEGIN
  4593.                    GETDIR(0,P);
  4594.                    F := DISPLAY_DIRECTORY(P,'*.*');
  4595.                END;
  4596.      
  4597.  
  4598.      
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.           ExtractWords                                                  StrngTTT
  4628.           
  4629.  
  4630.  
  4631.           Purpose   To extract a number specified number of words from a string.
  4632.  
  4633.           Returns   string;
  4634.  
  4635.           Declaration    ExtractWords(S,N: byte; Str: string):string;
  4636.                     
  4637.                     S is number of the first word to extract
  4638.                     N is the number of words to extract
  4639.                     Str is the string to extract from
  4640.  
  4641.           Uses StrngTTT.
  4642.  
  4643.           Remarks   If there are insufficient words to extract, the function
  4644.                     will return as many words as possible.
  4645.                     
  4646.                     If there are fewer than S words in the string, the function
  4647.                     returns a null string, i.e. ''.
  4648.  
  4649.           Example
  4650.  
  4651.  
  4652.                     USES STRNGTTT;
  4653.                     VAR LASTBIT : STRING;
  4654.                     BEGIN
  4655.                         LASTBIT := EXTRACTWORDS(4,3,'WHO THE HELL SAYS
  4656.                     CENSORSHIP IS GOOD!');
  4657.                     END.
  4658.           
  4659.  
  4660.           The string LastBit is assigned the value 'Censorship is good!'.
  4661.  
  4662.           
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.      First                                                         StrngTTT
  4694.      
  4695.  
  4696.  
  4697.      Purpose   To return the first part of a string.
  4698.  
  4699.      Returns   string;
  4700.  
  4701.      Declaration    First(N: byte; Str: string):string;
  4702.                
  4703.                N is the number of characters to extract.
  4704.                Str is the string to extract them from
  4705.  
  4706.      Uses StrngTTT.
  4707.  
  4708.      See also  Last
  4709.  
  4710.      Remarks   If the source string is fewer than N characters long, the
  4711.                whole string is returned.
  4712.  
  4713.      Example
  4714.  
  4715.  
  4716.                USES STRNGTTT;
  4717.                VAR TTT : STRING;
  4718.                BEGIN
  4719.                    TTT := FIRST(25,'ALL GOOD THINGS WILL COME TO PASS!');
  4720.                END.
  4721.      
  4722.  
  4723.      The string TTT is assigned the value "All good things will come".
  4724.  
  4725.      
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.           Int_to_Str                                                    StrngTTT
  4760.           
  4761.  
  4762.  
  4763.           Purpose   To convert an integer to a string.
  4764.  
  4765.           Returns   string;
  4766.  
  4767.           Declaration    Int_to_Str(Number: longInt):string;
  4768.                     
  4769.                     Number can actually be byte, integer or longint
  4770.  
  4771.           Uses StrngTTT.
  4772.  
  4773.           See also  Real_to_Str, Str_to_Int
  4774.  
  4775.           Example
  4776.  
  4777.  
  4778.                     USES STRNGTTT;
  4779.                     VAR TTT : STRING;
  4780.                     BEGIN
  4781.                         TTT := INT_TO_STR(130);
  4782.                     END.
  4783.           
  4784.  
  4785.           The value of TTT is set to '130'.
  4786.  
  4787.           
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.      Last                                                          StrngTTT
  4826.      
  4827.  
  4828.  
  4829.      Purpose   To return the last part of a string.
  4830.  
  4831.      Returns   string
  4832.  
  4833.      Declaration    Last(N: byte; Str: string):string;
  4834.                
  4835.                N is the number of characters to extract.
  4836.                Str is the string to extract them from
  4837.  
  4838.      Uses StrngTTT.
  4839.  
  4840.      See also  First
  4841.  
  4842.      Remarks   If the source string is fewer than N characters long, the
  4843.                whole string is returned.
  4844.  
  4845.      Example
  4846.  
  4847.  
  4848.                USES STRNGTTT;
  4849.                VAR TTT : STRING;
  4850.                BEGIN
  4851.                    TTT := LAST(11,'NEVER TAKE DRUGS!');
  4852.                END.
  4853.      
  4854.  
  4855.      The string TTT is assigned the value "Take Drugs!".
  4856.  
  4857.      
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.           LastPos                                                       StrngTTT
  4892.           
  4893.  
  4894.  
  4895.           Purpose   To find the last occurence of a character in a string.
  4896.  
  4897.           Returns   byte;
  4898.  
  4899.           Declaration    LastPos(C:char; Str:string):byte;
  4900.                     
  4901.                     C is the character to search for.
  4902.                     Str is the string to search
  4903.  
  4904.           Uses StrngTTT.
  4905.  
  4906.           See also  Pos (Turbo internal function)
  4907.  
  4908.           Remarks   If the character is not found in the string, the function
  4909.                     returns 0.
  4910.                     
  4911.                     The search is case sensitive.
  4912.  
  4913.           Example
  4914.  
  4915.  
  4916.                     USES STRNGTTT;
  4917.                     VAR B : BYTE;
  4918.                     BEGIN
  4919.                         B := LASTPOS('J','TECHNOJOCK SOFTWARE!');
  4920.                     END.
  4921.           
  4922.  
  4923.           The variable B is assigned the value 12
  4924.  
  4925.           
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.      Lower                                                         StrngTTT
  4958.      
  4959.  
  4960.  
  4961.      Purpose   To convert a string to lower case letters.
  4962.  
  4963.      Returns   String;
  4964.  
  4965.      Declaration    Lower(Str:string):string;
  4966.                
  4967.                Str is the string to be converted
  4968.  
  4969.      Uses StrngTTT.
  4970.  
  4971.      See also  Upper, Proper.
  4972.  
  4973.      Remarks   Only the upper case alphabet (A..Z) is affected.
  4974.  
  4975.      Example
  4976.  
  4977.  
  4978.                USES STRNGTTT;
  4979.                VAR TTT : STRING;
  4980.                BEGIN
  4981.                    TTT := LOWER('LEARNING TO TYPE');
  4982.                END.
  4983.      
  4984.  
  4985.      The string TTT is assigned the value "learning to type".
  4986.  
  4987.      
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.           OverType                                                      StrngTTT
  5024.           
  5025.  
  5026.  
  5027.           Purpose   To combine two overlapping strings.
  5028.  
  5029.           Returns   string;
  5030.  
  5031.           Declaration    OverType(N:byte; StrS,StrT:string):string;
  5032.                     
  5033.                     N is the character position that the StrT (target) will be
  5034.                     overlayed on the StrS (source).
  5035.  
  5036.           Uses StrngTTT.
  5037.  
  5038.           Remarks   If N is actually larger than the length of the source
  5039.                     string, the source string is extended with spaces ' ' i.e.
  5040.                     no problem.
  5041.                     
  5042.                     Any characters after the Nth position in StrS will be
  5043.                     replaced by the characters in StrT.
  5044.                     
  5045.                     If N + length(StrT) is less than the original length of StrS
  5046.                     then the last part of StrS will remain intact. (Phew!)
  5047.  
  5048.           Example
  5049.  
  5050.  
  5051.                     USES STRNGTTT;
  5052.                     VAR TTT : STRING;
  5053.                     BEGIN
  5054.                         TTT := OVERTYPE(5, 'BOB AINSBURY', 'TECHNOJOCK'));
  5055.                     END.
  5056.           
  5057.  
  5058.           The string TTT is assigned the value "Bob TechnoJock".
  5059.  
  5060.           
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.      PadCenter                                                     StrngTTT
  5090.      
  5091.  
  5092.  
  5093.      Purpose   Tp expand and center a string with a specific character.
  5094.  
  5095.      Returns   String;
  5096.  
  5097.      Declaration    PadCenter(Str:string; Size:byte; Pad:char):string;
  5098.                
  5099.                Str is the string to be expanded
  5100.                Size is the new string length
  5101.                Pad is the character to expand the string with
  5102.  
  5103.      Uses StrngTTT.
  5104.  
  5105.      See also  PadLeft, PadRight
  5106.  
  5107.      Example
  5108.  
  5109.  
  5110.                USES STRNGTTT;
  5111.                VAR TTT : STRING;
  5112.                BEGIN
  5113.                    TTT := PADCENTER(' ASTERISKS ',20,'*');
  5114.                END.
  5115.      
  5116.  
  5117.      The string TTT is assigned the value "***** Asterisk *****".
  5118.  
  5119.      
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.           PadLeft                                                       StrngTTT
  5156.           
  5157.  
  5158.  
  5159.           Purpose   To expand and left justify a string with a specific
  5160.                     character.
  5161.  
  5162.           Returns   String;
  5163.  
  5164.           Declaration    PadLeft(Str:string; Size:byte; Pad:char):string;
  5165.                     
  5166.                     Str is the string to be expanded
  5167.                     Size is the new string length
  5168.                     Pad is the character to expand the string with
  5169.  
  5170.           Uses StrngTTT.
  5171.  
  5172.           See also  PadCenter, PadRight
  5173.  
  5174.           Example
  5175.  
  5176.  
  5177.                     USES STRNGTTT;
  5178.                     VAR TTT : STRING;
  5179.                     BEGIN
  5180.                         TTT := PADLEFT(' ASTERISKS ',20,'*');
  5181.                     END.
  5182.           
  5183.  
  5184.           The string TTT is assigned the value " Asterisk **********".
  5185.  
  5186.           
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.      PadRight                                                      StrngTTT
  5222.      
  5223.  
  5224.  
  5225.      Purpose   To expand and right justify a string with a specific
  5226.                character.
  5227.  
  5228.      Returns   String;
  5229.  
  5230.      Declaration    PadRight(Str:string; Size:byte; Pad:char):string;
  5231.                
  5232.                Str is the string to be expanded
  5233.                Size is the new string length
  5234.                Pad is the character to expand the string with
  5235.  
  5236.      Uses StrngTTT.
  5237.  
  5238.      See also  PadCenter, PadLeft
  5239.  
  5240.      Example
  5241.  
  5242.  
  5243.                USES STRNGTTT;
  5244.                VAR TTT : STRING;
  5245.                BEGIN
  5246.                    TTT := PADRIGHT(' ASTERISKS ',20,'*');
  5247.                END.
  5248.      
  5249.  
  5250.      The string TTT is assigned the value "********** Asterisk ".
  5251.  
  5252.      
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.           PosWord                                                       StrngTTT
  5288.           
  5289.  
  5290.  
  5291.           Purpose   To determine the starting character position of a word.
  5292.  
  5293.           Returns   byte;
  5294.  
  5295.           Declaration    PosWord(WordNo:byte; Str:string):byte;
  5296.                     
  5297.                     WordNo is the number of the word to check
  5298.                     Str is the string to be analyzed
  5299.  
  5300.           Uses StrngTTT.
  5301.  
  5302.           See also  WordCnt, ExtractWords
  5303.  
  5304.           Remarks   The function returns zero if the string is a null or if
  5305.                     there are less than WordNo words in the string.
  5306.  
  5307.           Example
  5308.  
  5309.  
  5310.                     USES STRNGTTT;
  5311.                     VAR B : BYTE;
  5312.                     BEGIN
  5313.                         B := POSWORD(3,'THE QUICK BROWN LINEMAN');
  5314.                     END.
  5315.           
  5316.  
  5317.           The variable B is assigned the value 11.
  5318.  
  5319.           
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.      Proper                                                        StrngTTT
  5354.      
  5355.  
  5356.  
  5357.      Purpose   To convert a string so that each word begins with an
  5358.                uppercase letter.
  5359.  
  5360.      Returns   String;
  5361.  
  5362.      Declaration    Proper(Str:string): string;
  5363.                
  5364.                Str is the string to be converted
  5365.  
  5366.      Uses StrngTTT.
  5367.  
  5368.      See also  Lower, Upper.
  5369.  
  5370.      Remarks   Only the alphabet (a..z) is affected.
  5371.  
  5372.      Example
  5373.  
  5374.  
  5375.                USES STRNGTTT;
  5376.                VAR TTT : STRING;
  5377.                BEGIN
  5378.                    TTT := PROPER('R D AINSBURY');
  5379.                END.
  5380.      
  5381.  
  5382.      The string TTT is assigned the value "R D Ainsbury".
  5383.  
  5384.      
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.           Real_to_Str                                                   StrngTTT
  5420.           
  5421.  
  5422.  
  5423.           Purpose   To convert a real number to a string with a specified number
  5424.                     of decimal places.
  5425.  
  5426.           Returns   string;
  5427.  
  5428.           Declaration    Real_to_Str(R:real; Dec:byte):string;
  5429.                     
  5430.                     R is the real number
  5431.                     Dec is the number of decimal places for the string
  5432.  
  5433.           Uses StrngTTT.
  5434.  
  5435.           See also  Str_to_Real, Int_to_Str.
  5436.  
  5437.           Example
  5438.  
  5439.  
  5440.                     USES STRNGTTT;
  5441.                     VAR TTT : STRING;
  5442.                     BEGIN
  5443.                         TTT := REAL_TO_STR(12345.789990,2);
  5444.                     END.
  5445.           
  5446.  
  5447.           The string TTT is assigned the value "12345.79".
  5448.  
  5449.           
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.      Strip                                                         StrngTTT
  5486.      
  5487.  
  5488.  
  5489.      Purpose   To remove a character from a string
  5490.  
  5491.      Returns   string;
  5492.  
  5493.      Declaration    Strip(L,C:char; Str:string):string;
  5494.                
  5495.                L  is a character indicating which part of the string to
  5496.                strip the characters (see remarks)
  5497.                C is the character to strip
  5498.                Str is the string to strip
  5499.  
  5500.      Uses StrngTTT.
  5501.  
  5502.      Remarks   The valid values of L are
  5503.                'L' strip all leading characters
  5504.                'R' strip all trailing characters
  5505.                'B' strip leading and trailing characters
  5506.                'A' strip all occurences of the character
  5507.  
  5508.      Example
  5509.  
  5510.  
  5511.                USES STRNGTTT;
  5512.                VAR TTT : STRING;
  5513.                BEGIN
  5514.                    TTT := STRIP('B',' ','   THIS IS NEAT        ');
  5515.                END.
  5516.      
  5517.  
  5518.      The string TTT is assigned the value "This is neat".
  5519.  
  5520.      
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.           Str_to_Int                                                    StrngTTT
  5552.           
  5553.  
  5554.  
  5555.           Purpose   To convert a string to an integer
  5556.  
  5557.           Returns   integer;
  5558.  
  5559.           Declaration    Str_to_Int(Str:string): integer;
  5560.                     
  5561.                     Str is the string to be converted
  5562.  
  5563.           Uses StrngTTT.
  5564.  
  5565.           Remarks   If the string Str is null or the string cannot be
  5566.                     successfully converted to an integer, the function returns a
  5567.                     zero.
  5568.  
  5569.           
  5570.  
  5571.           See also  Str_to_Real, Int_to_Str.
  5572.  
  5573.           Example
  5574.  
  5575.  
  5576.                     USES STRNGTTT;
  5577.                     VAR I : INTEGER;
  5578.                     BEGIN
  5579.                         I := STR_TO_INT('165');
  5580.                     END.
  5581.           
  5582.  
  5583.           The variable I is assigned the value 165.
  5584.  
  5585.           
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.      Str_to_Real                                                   StrngTTT
  5618.      
  5619.  
  5620.  
  5621.      Purpose   To convert a string to an real.
  5622.  
  5623.      Returns   real;
  5624.  
  5625.      Declaration    Str_to_real(Str:string):real;
  5626.                
  5627.                Str is the string to be converted
  5628.  
  5629.      Uses StrngTTT.
  5630.  
  5631.      Remarks   If the string Str is null, or the string cannot be
  5632.                successfully converted to a real , the function returns a
  5633.                zero.
  5634.                
  5635.                This procedure gets around the bug in Turbo 4 that occurs
  5636.                when trying to convert a string starting with a '.',  to a
  5637.                number.
  5638.  
  5639.      See also  Str_to_Int, Real_to_Str.
  5640.  
  5641.      Example
  5642.  
  5643.  
  5644.                USES STRNGTTT;
  5645.                VAR R : INTEGER;
  5646.                BEGIN
  5647.                    R := STR_TO_REAL('165.787');
  5648.                END.
  5649.      
  5650.  
  5651.      The variable R is assigned the value 165.787 .
  5652.  
  5653.      
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.           Upper                                                         StrngTTT
  5684.           
  5685.  
  5686.  
  5687.           Purpose   To convert a string to upper case letters.
  5688.  
  5689.           Returns   String;
  5690.  
  5691.           Declaration    Upper(Str:string):string;
  5692.                     
  5693.                     Str is the string to be converted
  5694.  
  5695.           Uses StrngTTT.
  5696.  
  5697.           See also  Lower, Proper.
  5698.  
  5699.           Remarks   Only the  alphabet (a..z) is affected.
  5700.  
  5701.           Example
  5702.  
  5703.  
  5704.                     USES STRNGTTT;
  5705.                     VAR TTT : STRING;
  5706.                     BEGIN
  5707.                         TTT := UPPER('SMALL LETTERS');
  5708.                     END.
  5709.           
  5710.  
  5711.           The string TTT is assigned the value "SMALL LETTERS".
  5712.  
  5713.           
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.      WordCnt                                                        StrnTTT
  5750.      
  5751.  
  5752.  
  5753.      Purpose   To count the number of words in a string.
  5754.  
  5755.      Returns   byte;
  5756.  
  5757.      Declaration    WordCnt(Str:string):byte;
  5758.                
  5759.                Str is the string to be counted
  5760.  
  5761.      Uses StrngTTT.
  5762.  
  5763.      See also  ExtractWords, PosWord.
  5764.  
  5765.      Example
  5766.  
  5767.  
  5768.                USES STRNGTTT;
  5769.                VAR B : BYTE;
  5770.                BEGIN
  5771.                    B := WORDCNT('THATS ALL THE STRING FUNCTIONS, FOLKS!');
  5772.                END.
  5773.      
  5774.  
  5775.      The variable B is assigned the value 6.
  5776.  
  5777.      
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.           
  5816.  
  5817.           
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824.  
  5825.  
  5826.  
  5827.  
  5828.  
  5829.  
  5830.  
  5831.  
  5832.  
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.      Beep                                                           MiscTTT
  5882.      
  5883.  
  5884.  
  5885.      Purpose   To give 'em a beep.
  5886.  
  5887.      Declaration    Beep;
  5888.  
  5889.      Uses CRT, DOS, MiscTTT.
  5890.  
  5891.      Remarks   This gives a more pleasant tone than ^G.
  5892.  
  5893.      Example
  5894.  
  5895.  
  5896.                USES CRT, DOS, MISCTTT;
  5897.                BEGIN
  5898.                    IF ........  THEN
  5899.                       BEEP;
  5900.                END.
  5901.      
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.           Date                                                           MiscTTT
  5948.           
  5949.  
  5950.  
  5951.           Purpose   To display the system date nicely formatted
  5952.  
  5953.           Returns   String;
  5954.  
  5955.           Declaration    Date:string;
  5956.  
  5957.           Uses CRT, DOS, MiscTTT.
  5958.  
  5959.           See also  Time
  5960.  
  5961.           Remarks   The format of the returned string is the day followed by the
  5962.                     month, day of month and year e.g.
  5963.                     
  5964.                     Monday February 1, 1988
  5965.  
  5966.           Example
  5967.  
  5968.  
  5969.                     USES CRT, FASTTTT, DOS, MISCTTT;
  5970.                     BEGIN
  5971.                         CLRSCR;
  5972.                         WRITECENTER(1,YELLOW,BLACK,DATE);
  5973.                     END.
  5974.           
  5975.  
  5976.           The date would be written at the top center of the screen.
  5977.  
  5978.           
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.      Exists                                                         MiscTTT
  6014.      
  6015.  
  6016.  
  6017.      Purpose   To determine if a file exists
  6018.  
  6019.      Returns   Boolean;
  6020.  
  6021.      Declaration    Exists(Fl:string):boolean;
  6022.                
  6023.                Fl is the name of the file, including drive and path if
  6024.                necessary.
  6025.  
  6026.      Uses CRT, DOS, MiscTTT.
  6027.  
  6028.      Example
  6029.  
  6030.  
  6031.                USES CRT, DOS, MISCTTT;
  6032.                BEGIN
  6033.                    IF NOT EXIST('C:\CONFIG.SYS') THEN
  6034.                       BEEP;
  6035.                END.
  6036.      
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.           FlushKeyBuffer                                                 MiscTTT
  6080.           
  6081.  
  6082.  
  6083.           Purpose   To remove all keystrokes from the keyboard buffer.
  6084.  
  6085.           Declaration    FlushkeyBuffer;
  6086.  
  6087.           Remarks   This procedure is most frequently used when you want to stop
  6088.                     the type-ahead effect.
  6089.  
  6090.           Uses CRT, DOS, MiscTTT.
  6091.  
  6092.           Example
  6093.  
  6094.  
  6095.                     USES CRT, FASTTTT, DOS, MISCTTT;
  6096.                     VAR ANS : CHAR;
  6097.                     BEGIN
  6098.                          WRITEAT(1,WHEREY+1,WHITE,RED,'ARE YOU SURE YOU WANT TO
  6099.                     DELETE IT? (Y/N);
  6100.                          FLUSHKEYBUFFER;
  6101.                          ANS := GETKEY;
  6102.                          IF UPCASE(ANS) = 'Y' THEN
  6103.                             DELRECORD;
  6104.                     END.
  6105.           
  6106.  
  6107.           The keyboard is flushed in case the user had previously typed a Y in
  6108.           anticipation of a different question.
  6109.  
  6110.           
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.      Printer_Ready                                                  MiscTTT
  6146.      
  6147.  
  6148.  
  6149.      Purpose   To indicate if the printer is connected and online.
  6150.  
  6151.      Returns   boolean;
  6152.  
  6153.      Declaration    Printer_Ready: boolean;
  6154.  
  6155.      Uses CRT, DOS, MiscTTT;
  6156.  
  6157.      Remarks   This function is most useful when you want to bullet proof a
  6158.                printer option and makes sure that the printer is connected
  6159.                and on-line before trying to send it data.
  6160.  
  6161.      Example
  6162.  
  6163.  
  6164.                USES CRT, DOS, MISCTTT;
  6165.                BEGIN
  6166.                    IF PRINTER_READY THEN PRINTSCREEN;
  6167.                END.
  6168.      
  6169.  
  6170.      
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.           Print_Screen                                                   MiscTTT
  6212.           
  6213.  
  6214.  
  6215.           Purpose   To emulate the Print Scrn key.
  6216.  
  6217.           Declaration    PrintScreen
  6218.  
  6219.           Uses CRT, DOS, MiscTTT.
  6220.  
  6221.           Example
  6222.  
  6223.  
  6224.                     USES CRT, DOS, MISCTTT
  6225.                     BEGIN
  6226.                         PRINTSCREEN;
  6227.                     END.
  6228.           
  6229.  
  6230.           
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.      Reset_Printer                                                  MiscTTT
  6278.      
  6279.  
  6280.  
  6281.      Purpose   To clear a printer's settings back to the default.
  6282.  
  6283.      Declaration    Reset_Printer;
  6284.  
  6285.      Uses CRT, DOS, MiscTTT.
  6286.  
  6287.      See also  Printer_Ready.
  6288.  
  6289.      Remarks   This procedure uses a unique technique that will reset most
  6290.                of the PC printers on the market place today. It is
  6291.                recommended that this procedure be called prior to sending
  6292.                set-up strings to a printer.
  6293.  
  6294.      Example
  6295.  
  6296.  
  6297.                USES CRT, DOS, MISCTTT
  6298.                BEGIN
  6299.                    RESET_PRINTER;
  6300.                END.
  6301.      
  6302.  
  6303.      
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.           Time                                                           MiscTTT
  6344.           
  6345.  
  6346.  
  6347.           Purpose   To display the system time nicely formatted
  6348.  
  6349.           Returns   String;
  6350.  
  6351.           Declaration    Time:string;
  6352.  
  6353.           Uses CRT, DOS, MiscTTT;
  6354.  
  6355.           See also  Date.
  6356.  
  6357.           Remarks   The format of the returned string is hour:min:sec a.m. or
  6358.                     hour:min:sec p.m.
  6359.  
  6360.           Example
  6361.  
  6362.  
  6363.                     USES CRT, FASTTTT, DOS, MISCTTT;
  6364.                     BEGIN
  6365.                         CLRSCR;
  6366.                         WRITECENTER(1,YELLOW,BLACK,TIME);
  6367.                     END.
  6368.           
  6369.  
  6370.           The time would be written at the top center of the screen.
  6371.  
  6372.           
  6373.  
  6374.           
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.